1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hotbar saves

Discussion in 'Skript' started by SandyVerse, Apr 9, 2017.

Thread Status:
Not open for further replies.
  1. SandyVerse

    SandyVerse Well-Known Member

    Joined:
    Mar 19, 2017
    Messages:
    51
    Likes Received:
    0
    So I'm trying to have people use custom hotbars and to configure it themselves. This is what I have so far, and the hotbars won't save at all. Any help?

    What I have: https://pastebin.com/pK6C5idS
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Code (Skript):
    1. function hotbarUpdate(p: player):
    2.     loop integers from 0 to 8:
    3.         set {hotbar::slot::%loop-int%::%{_p}%} to {_p}'s slot loop-int
    4.  
    5. function hotbarRestore(p: player):
    6.     loop integers from 0 to 8:
    7.         set slot loop-int of {_p} to {hotbar::slot::%loop-int%::%{_p}%}
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Where would I put this?
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    These are just functions to let you know how to save/load hotbar items, you can learn from them.
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Also, I don't just want the hotbar saved, I want the entire inventory setup saved.
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    It's not a problem , just set 0 to 50. (Im not sure if are 50 the total of inventory slots.)
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    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.)
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Example:
    Code (Skript):
    1. command /inventory [<text>]:
    2.     trigger:
    3.         if arg-1 is "save":
    4.             hotbarUpdate(player)
    5.             message "Saved"
    6.         if arg-1 is "load":
    7.             hotbarRestore(player)
    8.             message "Loaded"
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    How would I use this and the functions to make the hotbar?
     
Thread Status:
Not open for further replies.
Loading...