• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Cool idea script please help

EstebanGod

New Member
Joined
Jun 18, 2014
Messages
83
Reaction score
3
Hello guys, so I got this script, what it does is that when you use the item it turns you into a monster and gives you speed bonus for like 1 minute.

Now id like to get some help so when you use this item you get a boost on your skills and magic level. help me out please, i mean i want it to work like a berserk potion kinda :/

Code:
function onUse(cid, item)
     local outfit ={lookType =342}--Outfit da montaria!
     local exhaust =60--Tempo para player poder usar o item novamente!(tempo em segundos)
     local time =60--Tempo para ficar na montaria!(tempo em segundos)
     local speed =300--Velocidade adicionada ao player após usar o item!(300= velocidade, quanto maior mais rapido...)
     local mana =100--Quantidade de mana que o player necessita para usar o sistema!
     local premium ="yes"--Apenas players premium accounts "yes"or"no"!?
     local storage =9393-- Não mexa aqui!
     
     if premium =="yes"andnot isPremium(cid)then
         return doPlayerSendTextMessage(cid,23,"Sorry, only premium players.")
     end
     if(getCreatureMana(cid)< mana)then
         return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
     end
     if(getPlayerStorageValue(cid, storage)<= os.time())then
         doCreatureSay(cid,"Yeeeah!!!\nYou went up on his ride.",19)
         doSetCreatureOutfit(cid, outfit, time*1000)
         doChangeSpeed(cid, speed)
         doSendMagicEffect(getCreaturePosition(cid),34)
         setPlayerStorageValue(cid, storage, os.time()+exhaust)
         doPlayerAddMana(cid,-mana)
         addEvent(doChangeSpeed, time*1000+40, cid,-speed)
         addEvent(doPlayerSendTextMessage, time*1000+45, cid,23,"Mount System is time out!")
         addEvent(doSendMagicEffect, time*1000+50, getCreaturePosition(cid),2)
         doRemoveItem(item.uid,1)
     else
         doPlayerSendCancel(cid,"Sorry, you only can again use this item after "..exhaust.." seconds.")
     end
     return TRUE
end
 
Last edited by a moderator:
Add condition at the top
Code:
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 1 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_SKILL_MELEE, 10)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, 10)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)

Then at the part where it adds speed.
Code:
doAddCondition(cid, condition)

For other kind of condition attributes params like skill and magiclevel, go to data/lib/000-constant.lua.
 
In 000-constant.lua you can find all the condition params you can use.

If you need help adding the condition to the script, post the errors you get and the script with the changes you made.
 

Similar threads

Back
Top