I'm currently making a crate system using skript, I just can't seem to get it working, I need to make it so I loops through the items when you right click a trapped chest, then those items in the trapped chest before you are the crate items, i've done this not using something similar to skript, but I'm not the best with skript. Here's my code:
Code:
command /crates:
trigger:
set {_crateChoice} to a random integer between 1 and 100
send "%{_crateChoice}%"
loop 27 times:
add 1 to {index}
set metadata tag "crates" of player to chest inventory with 3 rows named "&cTest"
set slot {index} of metadata tag "crates" of player to stone named "&6General Kenobi"
open (metadata tag "crates" of player) to player
set {index} to 0