function onUse(cid)
local monster = {
["Dragon"] = {1, 1800}
}
local cd = {
cdtime = 86400, --//-- quanto tempo fica sem usar o item
str = 69872,
}
tempo = 60000*30 --//-- tempo em segundos que o monstro vai ajudar o player
summon = getCreatureSummons(cid)
for l, m in pairs(monster) do
if getPlayerStorageValue(cid, cd.str) < os.time() and summon then
setPlayerStorageValue(cid, cd.str, os.time() + cd.cdtime)
doConvinceCreature(cid, doSummonCreature(l, getCreaturePosition(cid)))
doRemoveItem(item.uid, 1) -- Essa função faz com que o item seja removido!
doCreatureSay(cid, "Go!", 1)
doSendMagicEffect(getThingPos(cid), 10)
break
else
return doPlayerSendTextMessage(cid, 25, 'You can not use this item unless you wait..') and doSendMagicEffect(getThingPos(cid), 2)
end
end
for _, monster in ipairs(getCreatureSummons(cid)) do
addEvent(doRemoveCreature, tempo, monster)
end
if summon and getPlayerStorageValue(cid, cd.str) >= os.time() or getPlayerStorageValue(cid, cd.str) < os.time() then
for n, p in ipairs(summon) do
doRemoveCreature(p)
end
end
return true
end
Pronto removera o item quando for utilizado, se seu servidor for PDA ou DXP basta criar um "pokémon" que use apenas passiva ai ele vai soltar automaticamente a spell!