Hellooo!
I recently made this skript for a backpack:
function openBackpack(p: player):
open chest with 1 row named "Backpack" to {_p}
set {_s} to 0
loop 9 times:
set slot {_s} of {_p}'s current inventory to {backpack::%{_p}%::%{_s}%}
add 1 to {_s}
on inventory close:
if name of player's current inventory is "Backpack":
set {_s} to 0
loop 9 times:
set {backpack::%{_p}%::%{_s}%} to slot {_s} of player's current inventory
add 1 to {_s}
on right click:
if player's tool is chest:
openBackpack(player)
stop
if player's offhand tool is chest:
openBackpack(player)
stop
But the problem is it doesn't save the items (or doesn't load them). The inventory opens I put something in it, I close it, open it again and the item isn't there.
I recently made this skript for a backpack:
function openBackpack(p: player):
open chest with 1 row named "Backpack" to {_p}
set {_s} to 0
loop 9 times:
set slot {_s} of {_p}'s current inventory to {backpack::%{_p}%::%{_s}%}
add 1 to {_s}
on inventory close:
if name of player's current inventory is "Backpack":
set {_s} to 0
loop 9 times:
set {backpack::%{_p}%::%{_s}%} to slot {_s} of player's current inventory
add 1 to {_s}
on right click:
if player's tool is chest:
openBackpack(player)
stop
if player's offhand tool is chest:
openBackpack(player)
stop
But the problem is it doesn't save the items (or doesn't load them). The inventory opens I put something in it, I close it, open it again and the item isn't there.