Hey!
I am trying to create a command that saves all inventory items to a list. But when I try to load the inventory, it just randomly picks what slot to load. Any way I could save the slot?
[doublepost=1649709502,1649445765][/doublepost]
I figured it out, might not work haven't tested yet.
I am trying to create a command that saves all inventory items to a list. But when I try to load the inventory, it just randomly picks what slot to load. Any way I could save the slot?
[doublepost=1649709502,1649445765][/doublepost]
Code:
function saveInventory(p: player):
set {s} to 1
loop player's inventory 35 times:
set {%{s}%::loop} to loop-item
set {inventory:%player%:%{s}%} to loop-item
add 1 to {s}
function loadInventory(p: player):
set {_optionalLoopCount} to 1
loop player's inventory 35 times:
set slot {s} of loop-player's inventory to {%{s}%::loop}
add 1 to {_optionalLoopCOunt}
if {_optionalLoopCount} is 36:
send "Loading Finished | SkInventory" to player
I figured it out, might not work haven't tested yet.