• 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!

Storage +1 (done)

theduck

Member
Joined
Dec 6, 2018
Messages
246
Reaction score
20
player:setStorageValue(storage.name.name, +1)
No work
I'm trying to do when the player uses the item it will gain more storage
 
Solution
Lua:
player:setGlobalStorageValue(98231522, math.max(1, (player:getGlobalStorageValue(98231522) or 0) + 1))
idk why you have a "player" global storage value, but use this incase the get method returns nil
Lua:
player:setStorageValue(storage.name.name, player:getStorageValue(storage.name.name) + 1)
 
Lua:
player:setStorageValue(storage.name.name, player:getStorageValue(storage.name.name) + 1)
when i switch to global storage i have error using so it works


player:setGlobalStorageValue(98231522, player:getGlobalStorageValue(98231522) + 1)
 
Last edited:
Lua:
player:setGlobalStorageValue(98231522, math.max(1, (player:getGlobalStorageValue(98231522) or 0) + 1))
idk why you have a "player" global storage value, but use this incase the get method returns nil
 
Last edited:
Solution
Back
Top