Solved Inventory Save

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

bobby

Active Member
Jan 28, 2017
61
0
6
26
Is there anyway to make it so it saves the inventory of a player and then it will restore the inventory? If so how?
 
Those are just for the hotbar , you can still modify them and use for the whole inventory:
code_language.skript:
function hotbarUpdate(p: player):
    loop integers from 0 to 8:
        set {hotbar::slot::%loop-int%::%{_p}%} to {_p}'s slot loop-int
 
function hotbarRestore(p: player):
    loop integers from 0 to 8:
        set slot loop-int of {_p} to {hotbar::slot::%loop-int%::%{_p}%}
 
  • Like
Reactions: bobby
Those are just for the hotbar , you can still modify them and use for the whole inventory:
code_language.skript:
function hotbarUpdate(p: player):
    loop integers from 0 to 8:
        set {hotbar::slot::%loop-int%::%{_p}%} to {_p}'s slot loop-int
 
function hotbarRestore(p: player):
    loop integers from 0 to 8:
        set slot loop-int of {_p} to {hotbar::slot::%loop-int%::%{_p}%}
I'm not really good with functions how would I make it save the players inventory if a player does the command /save ?