@dgozdk Boa noite, pode ser que o seu servidor não possui a função doPlayerSendCancel, nesse caso tente esse outro script.
local timeStorage = 45644 -- não mexer
local config = {
time = 2, -- quanto tempo em segundos o player irá esperar para usar o item novamente
enableMessage = true, -- habilitar a mensagem : (true) habilita, (false) não habilita
}
local currentTime = 60 * config.time
function onUse(cid, item, frompos, item2, topos)
local dolls = {
[11256] = {pet = "Crystal Spider"},
[11207] = {pet = "Ashmunrah"},
[11144] = {pet = "Demon"},
[9019] = {pet = "Vampire"},
}
if (os.time() < getPlayerStorageValue(cid, timeStorage)) then
if (config.enableMessage) then
doPlayerSendTextMessage(cid, 4, "Voce tem que esperar "..config.time.." minuto(s) para usar o pet novamente.")
end
return
end
local go = dolls[item.itemid]
local summon = getCreatureSummons(cid)
---------------------------------------------------
if #summon >= 1 then
for _, pid in ipairs(summon) do
doRemoveCreature(pid)
doCreatureSay(cid, "Can go rest ["..go.pet.."]", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, timeStorage, os.time() + currentTime)
end
return true
end
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, "Let battle ["..go.pet.."]", TALKTYPE_ORANGE_1)
return true
end