Loop all itmes in block

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

Wynandus

Member
Aug 23, 2017
15
0
0
24
I want it to sell all the dirt in the chest every 10 seconds and give the money to the placer of the chest ({voidchest.owner.%location of block%}) can anyone help me do this? I would appreciate it so very much
code_language.skript:
on place of chest:
    if name of player's tool is "&bVoid Chest":
        if lore of player's tool is "&7This will automatically sell all items inside of the container.||&f||&b&lLIMITED TIME VOIDCHEST":
            add location of block to {voidchest.list::*}
            set {voidchest.owner.%location of block%} to player
            message "&e&l(!) &7You have placed down a voidchest!"

every 10 seconds in "world":
    loop items in block at {voidchest.list::*}'s inventory:
        if loop-item is dirt:
            set {_dirt} to number of dirt in event-block's inventory
            set {_value1} to {_dirt} * 100
            set {_addingmoney} to {_dirt}
            add {_addingmoney} to "%{voidchest.owner.%event-block%}%"'s balance
 
code_language.skript:
loop all items in inventory of block at {voidchest.list::*}:
    if loop-item is dirt:
        set {_amount} to amount of dirt in the inventory of block at {voidchest.list::*}
            add {_amount} to "%{voidchest.owner.%event-block%}%"'s balance

I don't know which part of your skript is not working so i edited this one. It may work im not sure tho
 
Last edited:
Status
Not open for further replies.