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.

Solved Refill chest issue

Discussion in 'Skript' started by Ariuw, Oct 14, 2021.

  1. Ariuw

    Ariuw Member

    Joined:
    Sep 6, 2017
    Messages:
    41
    Likes Received:
    0
    Hello there, I've been trying to refill chests between coordinates but I can't get it to work.. no errors are given tho. Here's the full code:

    Code (Text):
    1.  
    2. on load:
    3.    delete {random2.item.list::*}
    4.    add 1 diamond leggings to {random2.item.list::*}
    5.    add 1 diamond helmet to {random2.item.list::*}
    6.    add 1 diamond chestplate to {random2.item.list::*}
    7.    wait 1 tick
    8.    execute console command "/refill"
    9.  
    10. command /refill:
    11.    permission: chest.sk
    12.    trigger:
    13.        set {_item} to a random number between 3 and 6
    14.        loop all blocks between {_location-1} and {_location-2}:
    15.            if loop-blocks is a chest:
    16.                loop {_item} times:
    17.                    wait 5 ticks
    18.                    set {_randomitem} to random element out of {random2.item.list::*}
    19.                    wait 4 ticks
    20.                    add {_randomitem} to inventory of block at loop-value-1
    21.                broadcast "&aChests Refilled! &fNext refill, 5 minutes"
    22.  
    23.  
    24. command /loc2:
    25.    permission: loc.1
    26.    trigger:
    27.        set {_location-1} to location of player
    28.        broadcast {_location-1}
    29.            
    30. command /loc1:
    31.    permission: loc.1
    32.    trigger:
    33.        set {_location-2} to location of player
    34.        broadcast {_location-2}
    35.  
    36.  
    37. every 5 minutes:
    38.    execute console command "/refill"
    39.  


     
  2. Best Answer:
    Post #3 by Minecoll_YT, Oct 17, 2021
  3. oToghty

    VIP Supporter +

    Joined:
    Sep 1, 2020
    Messages:
    142
    Likes Received:
    5
    Does "&aChests Refilled! &fNext refill, 5 minutes" get broadcasted?
     
  4. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
    its
    Code (Text):
    1. loop blocks within {_location-1} and {_location-2}:
    not
    Code (Text):
    1. loop blocks between {_location-1} and {_location-2}:
     

Share This Page

Loading...