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:
on load:
delete {random2.item.list::*}
add 1 diamond leggings to {random2.item.list::*}
add 1 diamond helmet to {random2.item.list::*}
add 1 diamond chestplate to {random2.item.list::*}
wait 1 tick
execute console command "/refill"
command /refill:
permission: chest.sk
trigger:
set {_item} to a random number between 3 and 6
loop all blocks between {_location-1} and {_location-2}:
if loop-blocks is a chest:
loop {_item} times:
wait 5 ticks
set {_randomitem} to random element out of {random2.item.list::*}
wait 4 ticks
add {_randomitem} to inventory of block at loop-value-1
broadcast "&aChests Refilled! &fNext refill, 5 minutes"
command /loc2:
permission: loc.1
trigger:
set {_location-1} to location of player
broadcast {_location-1}
command /loc1:
permission: loc.1
trigger:
set {_location-2} to location of player
broadcast {_location-2}
every 5 minutes:
execute console command "/refill"