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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
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}%}
 
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}%}

Where would I put this?
 
Where would I put the functions in the skript? (I can do simple things in skript, nothing like this though, so I'm a bit confused.)
 
Example:
code_language.skript:
command /inventory [<text>]:
    trigger:
        if arg-1 is "save":
            hotbarUpdate(player)
            message "Saved"
        if arg-1 is "load":
            hotbarRestore(player)
            message "Loaded"
 
Example:
code_language.skript:
command /inventory [<text>]:
    trigger:
        if arg-1 is "save":
            hotbarUpdate(player)
            message "Saved"
        if arg-1 is "load":
            hotbarRestore(player)
            message "Loaded"

How would I use this and the functions to make the hotbar?
 
Status
Not open for further replies.