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 out 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.

How to save player's armor

Discussion in 'Skript' started by Dxstin, Mar 6, 2021.

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

    Dxstin Member

    Joined:
    Oct 1, 2020
    Messages:
    15
    Likes Received:
    1
    Hey,
    I'm trying to write an inventory save script for my citybuild script, everything works fine except the armor is not saved? Does anyone know maybe how to save the armor in a value and recall it?

    Thanks already!
     
  2. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    This method is easy and should even save the armor
    Code (Skript):
    1. command /saveinv:
    2.     trigger:
    3.         loop 41 times:
    4.             set {inv.%player%::%loop-number%} to slot loop-number -1 of player
    5.         send "&aInventory saved!"
    6.  
    7. command /loadinv:
    8.     trigger:
    9.         loop 41 times:
    10.             set slot loop-number -1 of player to {inv.%player%::%loop-number%}
    11.         send "&aInventory loaded!"
     
  3. Dxstin

    Dxstin Member

    Joined:
    Oct 1, 2020
    Messages:
    15
    Likes Received:
    1
    Thank you! I will test it out! :emoji_wink:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...