Need help looping items in a chest and removing them

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

Hassan7000

Member
Mar 12, 2018
23
3
0
24
hey im creating a chestsell skript that allow players to easy sell there loot and i dont know how to loop the items in the chest and removing them and how many items there are in the chest and what items



  1. code_language.skript:
    on sign change:
        if line 1 is "[ChestSell]":
            set line 1 to "&7[&6&lChestSell&7]"
            set line 2 to "&6&l%player%"
            message "&aYou have created a ChestSell"
          
    on rightclick on a chest or trapped chest:
        if type of loop-block is wall sign:
          if line 1 of loop-block is "&7[&6&lChestSell&7]":
            set {chestloc.%player%} to location of loop-block
            remove 1 sign from {_tmpchest}
I have tried something here but its not working
 
{_tmpchest} is a local variable and is not set to anything so it won't do anything. Some ways to remove items from a chest are doing "remove %itemstack% from inventory of block at %location%" or "loop all items in inventory of block at %location%"
 
Status
Not open for further replies.