How do I edit this script to check the value of Storage?
It's there in the part of Mining Skill, I tried to create a check but I do not understand script uhahuahua
Well, what happens is that when the player logs in the first time he has to set the value of STORAGE 15002 to 1 and 15003 to 0. But it has to have a check, because only if I log it set to 1 Again .
function onLogin(player)
local targetVocation = config[player:getVocation():getId()]
if not targetVocation then
return true
end
if player:getLastLoginSaved() ~= 0 then
return true
end
for i = 1, #targetVocation.items do
player:addItem(targetVocation.items[1], targetVocation.items[2])
end
if getPlayerStorage(15002) <= 0 and getplayerStorage(15003) >= 1 then
player:setStorageValue(15002, 1) -- Mining Skill
player:setStorageValue(15003, 0) -- Mining Skill Tries
return true
end
local backpack = player:addItem(1988)
if not backpack then
return true
end
for i = 1, #targetVocation.container do
backpack:addItem(targetVocation.container[1], targetVocation.container[2])
end
return true
end
local targetVocation = config[player:getVocation():getId()]
if not targetVocation then
return true
end
if player:getLastLoginSaved() ~= 0 then
return true
end
for i = 1, #targetVocation.items do
player:addItem(targetVocation.items[1], targetVocation.items[2])
end
if getPlayerStorage(15002) <= 0 and getplayerStorage(15003) >= 1 then
player:setStorageValue(15002, 1) -- Mining Skill
player:setStorageValue(15003, 0) -- Mining Skill Tries
return true
end
local backpack = player:addItem(1988)
if not backpack then
return true
end
for i = 1, #targetVocation.container do
backpack:addItem(targetVocation.container[1], targetVocation.container[2])
end
return true
end
It's there in the part of Mining Skill, I tried to create a check but I do not understand script uhahuahua
Well, what happens is that when the player logs in the first time he has to set the value of STORAGE 15002 to 1 and 15003 to 0. But it has to have a check, because only if I log it set to 1 Again .