code:
the code is supposed to not let the player close the "class gui" inventory. this code works the first time they close the inventory, but once they close it a second time, nothing happens. its like the inventory name ins't "Choose your class" after classgui(player) runs
Posted by: cybong_gaming from the skUnity Discord. View the thread on skUnity Discord here
code_language.skript:
vb
on inventory close:
if name of event-inventory contains "Choose your class":
classgui(player)
function:
vb
function classgui(p: player):
set {ingui::%uuid of {_p}%} to {_p}'s uuid
if team of {_p} is {r} or {b}:
if team of {_p} is {r}:
set {_guinamecolor} to "&4&l"
else:
if team of {_p} is {b}:
set {_guinamecolor} to "&1&l"
else:
set {_guinamecolor} to "&f&l"
set {_classgui} to a new chest inventory with 1 row with name "%{_guinamecolor}%Choose your class"
Posted by: cybong_gaming from the skUnity Discord. View the thread on skUnity Discord here