inventory loop help

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

FallingCatus

Member
Jun 29, 2017
38
0
6
33
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:
Options:
    Prefix: &fPixel&aislands &8-
    Message_On_Respawn: &7Your items are being loaded...
    Message_Warning: &cIf you open the locker and closed it all the items inside will be lost forever! # Message #
    ItemOnRespawn: chest
    ItemOnRespawnName: &f&lPixel&a&lLocker
    GUINameOnOpen: &a&lLocker &f%player%


on death of a player:
    loop all items in the inventory of player:
        add loop-item to {chargeback.%uuid of victim%::*}
        set {chargeback.enabled.%uuid of victim%} to true
        wait 2 seconds
        clear player's inventory
       
on respawn:
    if {chargeback.enabled.%uuid of player%} is true:
        message "{@Prefix}: {@Message_On_Respawn}"
        wait 3 seconds
        give {@ItemOnRespawn} named "{@ItemOnRespawnName}" to player
        wait 1 tick
        message "{@Prefix}: {@Message_Warning}"
        set {chargeback.enabled.%uuid of player%} to false

on right click:
    if player's tool is {@ItemOnRespawn} named "{@ItemOnRespawnName}":
        open chest with 6 row named "{@GUINameOnOpen}" to player
        wait 2 ticks
        add {chargeback.%uuid of player%::*} to player's current inventory
        wait 2 ticks
        remove 1 of {@ItemOnRespawn} named "{@ItemOnRespawnName}" from player
        delete {chargeback.%uuid of player%::*}
 
Last edited:
try this
Code:
on right click:
    if player's tool is {@ItemOnRespawn} named "{@ItemOnRespawnName}":
        open chest with 6 row named "{@GUINameOnOpen}" to player
        wait 2 ticks
        loop {chargeback.%uuid of player%::*}:
            add loop-value to player's current inventory
        wait 2 ticks
        remove 1 of {@ItemOnRespawn} named "{@ItemOnRespawnName}" from player
        delete {chargeback.%uuid of player%::*}
 
Status
Not open for further replies.