Ir para conteúdo
  • 0

[PEDIDO] Colocar colddown na action


surfnament

Pergunta

Eu uso um pet system mas as pessoas podem usar sem delay algum o item , o que acaba causando alguns legs e erros no console...

Queria pedir para alguem colocar um colddown na action:


function onUse(cid, item, frompos, item2, topos)

local dolls = {
[2108] = {pet = "Sabrewulf"},
[3955] = {pet = "Dark Cucka"},
[5810] = {pet = "Dragon Infernal"},
[11250] = {pet = "Hacker"},
[8982] = {pet = "Heroi"},
[11201] = {pet = "Macumbeiro"},
[7958] = {pet = "Bobo da Corte"},
[9019] = {pet = "[VIP] Knight"},
[6567] = {pet = "Crystal Spider"},
[2322] = {pet = "rat"},
[7183] = {pet = "Demon"},

}
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)
end
return true
end

doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, "Let battle ["..go.pet.."]", TALKTYPE_ORANGE_1)
return true
end

 

 

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

Ta ai.

 

 

function onUse(cid, item, frompos, item2, topos)

local temp = {
exhausted = 2, --delay
storage = 304 -- storage
}
local dolls = {
[2108] = {pet = "Sabrewulf"},
[3955] = {pet = "Dark Cucka"},
[5810] = {pet = "Dragon Infernal"},
[11250] = {pet = "Hacker"},
[8982] = {pet = "Heroi"},
[11201] = {pet = "Macumbeiro"},
[7958] = {pet = "Bobo da Corte"},
[9019] = {pet = "[VIP] Knight"},
[6567] = {pet = "Crystal Spider"},
[2322] = {pet = "rat"},
[7183] = {pet = "Demon"},
}
local go = dolls[item.itemid]
local summon = getCreatureSummons(cid)
---------------------------------------------------
if(getPlayerStorageValue(cid, temp.storage) > os.time() and getPlayerStorageValue(cid, temp.storage) < 100+os.time()) then
doPlayerSendTextMessage(cid, 24, "você esta exausto, espere " .. getPlayerStorageValue(cid, temp.storage) - os.time() .. ' segundo' .. ((getPlayerStorageValue(cid, temp.storage) - os.time()) == 1 and "" or "s"))
return true
end
if #summon >= 1 then
for _, pid in ipairs(summon) do
doRemoveCreature(pid)
doCreatureSay(cid, "Can go rest ["..go.pet.."]", TALKTYPE_ORANGE_1)
end
return true
end
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, "Let battle ["..go.pet.."]", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, temp.storage, os.time() + temp.exhausted)
return true
end
Editado por craigmabbit
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...