roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,188
- Solutions
- 34
- Reaction score
- 200
My table can have a maximum of 4 numbers.
for example if the player's storage is 900 (it is greater than 880 and less than 1000), then it must enter the table between these values, like it:
newTable ={1000, 900, 880, 720}
and the value 600 leaves the table, since it can only have 4 values, the smallest always leaves, when some other value enters
Lua:
local table = {1000, 880, 720, 600}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(1200) > Some Value in table then
table[X] = player:getStorageValue(1200)
end
return true
end
for example if the player's storage is 900 (it is greater than 880 and less than 1000), then it must enter the table between these values, like it:
newTable ={1000, 900, 880, 720}
and the value 600 leaves the table, since it can only have 4 values, the smallest always leaves, when some other value enters