Hi. I'm only now starting on functions, could anyone help me with why this doesn't work? Thank you!
Code:
function gui(title: text):
wait 1 tick
open chest with 5 rows named "%{_title}%" to player
wait 2 tick
set {_slot} to 0
loop 24 times:
if {_slot} is 10:
set {_slot} to 17
else if {_slot} is 19:
set {_slot} to 26
else if {_slot} is 28:
set {_slot} to 35
else if {_slot} is 45:
stop
if inventory name of player's current inventory is "%{_title}%":
if {_slot} is 0 or 2 or 4 or 6 or 8 or 10 or 18 or 26 or 36 or 38 or 40 or 42 or 44:
format slot {_slot} of player with {b} to be unstealable
else:
format slot {_slot} of player with {r} to be unstealable
add 1 to {_slot}
command /function:
trigger:
gui(test)