aki está
setPlayerStorageValue(cid,11548,os.time()+30)
está configurado para so poder usar a cada 30 segundos ai é so você alterar onde tá +30 pro tempo que você quiser.
function onSay(cid, words, param)
if (getPlayerStorageValue(cid, 11548) >= os.time()) then
doPlayerSendTextMessage(cid, 6,"Por medidas de segurança você só pode utilizar este comando em " ..
(getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")
return TRUE
end
function onUse(cid, item, frompos, item2, topos)
storage = 4191
storsol = 1203
if #getCreatureSummons(cid) > 1 then
doPlayerSendCancel(cid,"Your Demonio is already summoned.")
end
if getPlayerStorageValue(cid,storsol) == 1 then
local z = getCreatureSummons(cid)[1]
addEvent(setPlayerStorageValue,100,cid,storsol,-1)
doPlayerSay(cid,"Back my summon!",TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(z), 2)
doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 3)
doRemoveCreature(z)
end
local summons = getCreatureSummons(cid)
local pet = {
["Bug"] = {1,250},
["Death Blob"] = {251,1500},
["Worker golem"] = {1501,5000},
["werewolf"] = {5001,9999},
["Mercury Blob"] = {10000,15000},
["Flufly"] = {15001,23000},
["haunted treeling"] = {23001,30000},
["Vampire Bride"] = {30001,40000},
["Grim Reaper"] = {40001,55000},
["Zombie"] = {55001,80000},
["Azure Frog"] = {80001,400000}
}
for k,v in pairs(pet) do -- 1
if getPlayerStorageValue(cid,storsol) < 1 then
if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2
if (table.maxn(summons) < 1)then -- 3
x = doSummonCreature(k, getCreaturePosition(cid))
doConvinceCreature(cid, x)
setPlayerStorageValue(cid,4194,1)
setPlayerStorageValue(cid,11548,os.time()+30)
setPlayerStorageValue(cid,storsol,1)
doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
end
end
end
end
return true
end






info
Grupo: Visconde
Registrado: 11/04/12
Posts: 328
Reputação: +7
Char no Tibia: ADM MiHawk
Preciso que alguem coloke para esse sistema de pet nao poder ser usado em pz, ele é talkaction, e queria tambem que colokasse exausted... obrigado *-*
function onUse(cid, item, frompos, item2, topos)
storage = 4191
storsol = 1203
if #getCreatureSummons(cid) > 1 then
doPlayerSendCancel(cid,"Your Demonio is already summoned.")
end
if getPlayerStorageValue(cid,storsol) == 1 then
local z = getCreatureSummons(cid)[1]
addEvent(setPlayerStorageValue,100,cid,storsol,-1)
doPlayerSay(cid,"Back my summon!",TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(z), 2)
doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 3)
doRemoveCreature(z)
end
local summons = getCreatureSummons(cid)
local pet = {
["Bug"] = {1,250},
["Death Blob"] = {251,1500},
["Worker golem"] = {1501,5000},
["werewolf"] = {5001,9999},
["Mercury Blob"] = {10000,15000},
["Flufly"] = {15001,23000},
["haunted treeling"] = {23001,30000},
["Vampire Bride"] = {30001,40000},
["Grim Reaper"] = {40001,55000},
["Zombie"] = {55001,80000},
["Azure Frog"] = {80001,400000}
}
for k,v in pairs(pet) do -- 1
if getPlayerStorageValue(cid,storsol) < 1 then
if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2
if (table.maxn(summons) < 1)then -- 3
x = doSummonCreature(k, getCreaturePosition(cid))
doConvinceCreature(cid, x)
setPlayerStorageValue(cid,4194,1)
setPlayerStorageValue(cid,storsol,1)
doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
end
end
end
end
return true
end