Custom Enderchest Bug

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

Zsoz25K

Member
Oct 1, 2019
2
0
1
20
I have problem with my custom enderchest skript. If i first open the enderchest then save my items, but
secondly i open the enderchest the old ones appear, but the new ones are not saved.
Code:
on rightclick on a ender chest:
    cancel event
    open chest with 5 rows named "Big EnderChest" to player
    set {_s} to 0
    loop {enderchest.%player%::*}:
        set slot {_s} of player's current inventory to loop-value
        add 1 to {_s}
    
on inventory close:
    if name of event-inventory is "Big EnderChest":
        loop inventory size of event-inventory times:
            add slot (loop-number - 1) of player's current inventory to {enderchest.%player%::*}
 
I have problem with my custom enderchest skript. If i first open the enderchest then save my items, but
secondly i open the enderchest the old ones appear, but the new ones are not saved.
Code:
on rightclick on a ender chest:
    cancel event
    open chest with 5 rows named "Big EnderChest" to player
    set {_s} to 0
    loop {enderchest.%player%::*}:
        set slot {_s} of player's current inventory to loop-value
        add 1 to {_s}
  
on inventory close:
    if name of event-inventory is "Big EnderChest":
        loop inventory size of event-inventory times:
            add slot (loop-number - 1) of player's current inventory to {enderchest.%player%::*}
You need to specify the inventory that has been closed.
Use this for that:
Code:
add slot (loop-number - 1) of player's current inventory to {enderchest.%player%::*}
 
Status
Not open for further replies.