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.

inventory loop help

Discussion in 'Skript' started by FallingCatus, Dec 17, 2019.

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

    FallingCatus Member

    Joined:
    Jun 29, 2017
    Messages:
    38
    Likes Received:
    0
    The skript loads without error.
    on death of the player the items are removed.

    on respawn the chest is given to the player but upon open only 1 item/stack is in the gui.

    any help would be great, thanks


    Code (Text):
    1. Options:
    2.     Prefix: &fPixel&aislands &8-
    3.     Message_On_Respawn: &7Your items are being loaded...
    4.     Message_Warning: &cIf you open the locker and closed it all the items inside will be lost forever! # Message #
    5.     ItemOnRespawn: chest
    6.     ItemOnRespawnName: &f&lPixel&a&lLocker
    7.     GUINameOnOpen: &a&lLocker &f%player%
    8.  
    9.  
    10. on death of a player:
    11.     loop all items in the inventory of player:
    12.         add loop-item to {chargeback.%uuid of victim%::*}
    13.         set {chargeback.enabled.%uuid of victim%} to true
    14.         wait 2 seconds
    15.         clear player's inventory
    16.        
    17. on respawn:
    18.     if {chargeback.enabled.%uuid of player%} is true:
    19.         message "{@Prefix}: {@Message_On_Respawn}"
    20.         wait 3 seconds
    21.         give {@ItemOnRespawn} named "{@ItemOnRespawnName}" to player
    22.         wait 1 tick
    23.         message "{@Prefix}: {@Message_Warning}"
    24.         set {chargeback.enabled.%uuid of player%} to false
    25.  
    26. on right click:
    27.     if player's tool is {@ItemOnRespawn} named "{@ItemOnRespawnName}":
    28.         open chest with 6 row named "{@GUINameOnOpen}" to player
    29.         wait 2 ticks
    30.         add {chargeback.%uuid of player%::*} to player's current inventory
    31.         wait 2 ticks
    32.         remove 1 of {@ItemOnRespawn} named "{@ItemOnRespawnName}" from player
    33.         delete {chargeback.%uuid of player%::*}
    34.  
     
    #1 FallingCatus, Dec 17, 2019
    Last edited: Dec 17, 2019
  2. Vorze

    Vorze Active Member

    Joined:
    Jul 10, 2017
    Messages:
    69
    Likes Received:
    2
    try this
    Code (Text):
    1. on right click:
    2.     if player's tool is {@ItemOnRespawn} named "{@ItemOnRespawnName}":
    3.         open chest with 6 row named "{@GUINameOnOpen}" to player
    4.         wait 2 ticks
    5.         loop {chargeback.%uuid of player%::*}:
    6.             add loop-value to player's current inventory
    7.         wait 2 ticks
    8.         remove 1 of {@ItemOnRespawn} named "{@ItemOnRespawnName}" from player
    9.         delete {chargeback.%uuid of player%::*}
    10.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...