acho que isso deve funciona
function onSay(cid, words, param, itemEx, params)
local summons = getCreatureSummons(cid)
if words == "!petback" then
for k = 1, #summons do
doRemoveCreature(summons[k])
end
return True
end
local pet = {
["Pet Verde"] = {100,400},
["Pet Azul"] = {401,700},
["Pet Vermelho"] = {701,9999}
}for k,v in pairs(pet) do -- 1
if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2
if getPlayerStorageValue(cid, 78552) == 1 then -- 3
if (table.maxn(summons) < 1)then -- 4
if getTilePzInfo(getCreaturePosition(cid)) == false then --5
x = doSummonCreature(k, getCreaturePosition(cid))
doConvinceCreature(cid, x)
doCreatureSay(cid, k ..", go!", 1)doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
else
doPlayerSendCancel(cid,"Você não pode sumonar seu Pet em Pz.")
return true
end -- 5
else
doPlayerSendCancel(cid,"Você só pode sumonar 1 Pet.")
return true
end -- 4
else
doPlayerSendCancel(cid,"Você não tem um Pet.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você não tem um Pet.")
end -- 3
else
doPlayerSendCancel(cid,"Pet System.")
end -- 2
end -- 1
return true
end




info
Grupo: Barão
Registrado: 24/02/10
Posts: 204
Reputação: +14
Char no Tibia: Krewcz
Eu uso um sistema de PET por Talkactions, porem quando qualquer player (Mesmo que não tenho pet) Falar !petback e meu pet tiver logado, ele desloga, eu queria que apenas EU (o dono do pet) podesse deslogar ele.
Script:
function onSay(cid, words, param, itemEx, params) local summons = getCreatureSummons(cid)if isCreature(cid) then if words == "!petback" then doRemoveCreature(x) return True end end local pet = { ["Pet Verde"] = {100,400}, ["Pet Azul"] = {401,700}, ["Pet Vermelho"] = {701,9999} }for k,v in pairs(pet) do -- 1 if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2 if getPlayerStorageValue(cid, 78552) == 1 then -- 3 if (table.maxn(summons) < 1)then -- 4 if getTilePzInfo(getCreaturePosition(cid)) == false then --5 x = doSummonCreature(k, getCreaturePosition(cid)) doConvinceCreature(cid, x) doCreatureSay(cid, k ..", go!", 1)doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2) else doPlayerSendCancel(cid,"Você não pode sumonar seu Pet em Pz.") return true end -- 5 else doPlayerSendCancel(cid,"Você só pode sumonar 1 Pet.") return true end -- 4 else doPlayerSendCancel(cid,"Você não tem um Pet.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você não tem um Pet.") end -- 3 else doPlayerSendCancel(cid,"Pet System.") end -- 2 end -- 1 return true endEditado Março 20 por kelvinvictor