I added this script on my server, to use the pet when you complete a quest, click on the statue, you get the StorageValue, I even used the StorageValue of the vip area to test, but always when you click on the item it says that you need to do the quest like I haven't yet I have the StorageValue, and in the vip area it can be accessed, but using the pet says it can't. I tried to run the script but I don't understand much. Could someone modify it for me please.
function onUse(cid, item, frompos, item2, topos)
local dolls = {
[11187] = {pet = "Ghazbaran"},
[10575] = {pet = "Dracola"},
[11254] = {pet = "Bazir"},
[11253] = {pet = "Apocalypse"},
}
local go = dolls[item.itemid]
local summon = getCreatureSummons(cid)
---------------------------------------------------
if not (getTilePzInfo(getCreaturePosition(cid))) then
if #summon >= 1 then
for _, pid in ipairs(summon) do
doRemoveCreature(pid)
doCreatureSay(cid, ""..go.pet..", Recuar!", TALKTYPE_ORANGE_1)
end
return true
end
if item.itemid == 11254 then
if getPlayerStorageValue(cid, 14046) - os.time() <= 0 then
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 19, "Voce precisa da quest para usar esse PET!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
end
end
if item.itemid == 11187 then
if getPlayerStorageValue(cid, 14048) - os.time() <= 0 then
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 19, "Voce precisa da quest para usar esse PET!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
end
end
if item.itemid == 10575 then
if getPlayerStorageValue(cid, 14047) - os.time() <= 0 then
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 19, "Voce precisa fazer a quest para usar esse PET!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
end
end
if item.itemid == 11253 then
if getPlayerStorageValue(cid, 17540) - os.time() <= 0 then
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 19, "Voce precisa fazer a quest para usar esse PET!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
end
end
else
doPlayerSendTextMessage(cid, 19, "Voce nao pode sumonar seu PET em Protect Zone!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
return true
end
end
local dolls = {
[11187] = {pet = "Ghazbaran"},
[10575] = {pet = "Dracola"},
[11254] = {pet = "Bazir"},
[11253] = {pet = "Apocalypse"},
}
local go = dolls[item.itemid]
local summon = getCreatureSummons(cid)
---------------------------------------------------
if not (getTilePzInfo(getCreaturePosition(cid))) then
if #summon >= 1 then
for _, pid in ipairs(summon) do
doRemoveCreature(pid)
doCreatureSay(cid, ""..go.pet..", Recuar!", TALKTYPE_ORANGE_1)
end
return true
end
if item.itemid == 11254 then
if getPlayerStorageValue(cid, 14046) - os.time() <= 0 then
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 19, "Voce precisa da quest para usar esse PET!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
end
end
if item.itemid == 11187 then
if getPlayerStorageValue(cid, 14048) - os.time() <= 0 then
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 19, "Voce precisa da quest para usar esse PET!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
end
end
if item.itemid == 10575 then
if getPlayerStorageValue(cid, 14047) - os.time() <= 0 then
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 19, "Voce precisa fazer a quest para usar esse PET!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
end
end
if item.itemid == 11253 then
if getPlayerStorageValue(cid, 17540) - os.time() <= 0 then
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 19, "Voce precisa fazer a quest para usar esse PET!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
end
end
else
doPlayerSendTextMessage(cid, 19, "Voce nao pode sumonar seu PET em Protect Zone!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
return true
end
end