Code:
set {_inventory} to a chest inventory
set metadata value "huntGUI" of {_p} to chest inventory with 7 rows with name " &c%{_time}% seconds left!"
set metadata value "huntGUI_IN" of {_p} to 1
set {_item} to gray concrete with name "&aClick Me!"
loop {_diff} times:
set slot random integer between 0 and 51 of metadata value "huntGUI" of {_p} to {_item}
open metadata value "huntGUI" of {_p} to {_p}
set {_loopTimes} to {_time}
set {_iteration} to 0
loop {_loopTimes} times:
if {_time} is 0:
stop
play sound "block.note_block.harp" to {_p}
set {_iteration} to {_iteration} + 1
wait 1 seconds
set name of metadata value "huntGUI" of {_p} to " &c%{_loopTimes} - {_iteration}% seconds left!"
send "%{_time} - {_iteration}%" to {_p}
For some reason, this code does not function. I am trying to update the name of the inventory opened, and it works the first time, changing from 10 to 9, but then stays stuck at 9. I have no idea why this is happening and suspect it may be a nuance of Skript as a language. Any thoughts?