problem: I want my variable to be only in the range [0,21] i.e. never less than 0 or greater than 21.
my code is:
Posted by: justaunknown from the skUnity Discord. View the thread on skUnity Discord here
my code is:
code_language.skript:
function startBossbar(p: player):
if {bossbar.%{_p}%} is set:
if {num} is greater than or equal to 0:
if {action.%{_p}%} is "break":
set {num} to {num}+1
if {num} is less than or equal to 21:
if {action.%{_p}%} is "place":
set {num} to {num}-1
else:
set {bossbar.%{_p}%} to boss bar named "bossbar.%{_p}%" with title "example 1" with color yellow with progress 50
set {num} to 0
add {_p} to {bossbar.%{_p}%}
Posted by: justaunknown from the skUnity Discord. View the thread on skUnity Discord here