• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help Simples pet StorageValue

Fiapo

New Member
Joined
Dec 21, 2018
Messages
12
Reaction score
0
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
 
ctrl + f
<=

change to > in all four occurrences.


explaining it:
probably your vip system sets the storage value to a os.time() + X seconds (like 1 month in seconds?)
if you want that VIP players can use PET, you need to check if the current os.time is below the value set in storage value.

storage - os.time > 0 means you still have some vip time remaining.
 
ctrl + f
<=

change to > in all four occurrences.


explaining it:
probably your vip system sets the storage value to a os.time() + X seconds (like 1 month in seconds?)
if you want that VIP players can use PET, you need to check if the current os.time is below the value set in storage value.

storage - os.time > 0 means you still have some vip time remaining.
Bro I was confused about what you said, but I ended up understanding, and solved it now yes it's working lol, I don't know script I'm messed up thanks a lot bro
 
Back
Top