So basically, I was making a cooldown command, incase any cooldown that I make gets stuck, but for some reason, it doesn't work. Basically how it works is it checks for any variable (that I manually insert) that is more than 0, we will call this a check, after 5 ticks, which should be enough for the cooldown/variable to go down, it will check if the variable is not less/higher than the check. When I make it check for not less, it works for every variable even if the check doesn't exist. When I make it check for higher, it doesn't work on any of them, even if the math is right. Any help?
Code:
command /cooldown [<text>] [<text>]:
permission: op
trigger:
if arg-1 is set:
if arg-1 is "add":
add arg-2 to {AllCooldowns::*}
if arg-1 is "remove":
remove arg-2 from {AllCooldowns::*}
if arg-1 is "list":
loop {AllCooldowns::*}:
send "%{AllCooldowns::%loop-index%}%" to player
else:
loop {AllCooldowns::*}:
if {%loop-value%::%player%} is higher than 0:
set {CooldownCheck_%loop-value%::%player%} to "%{%loop-value%::%player%}%"
send "%{%loop-value%::%player%}%" to player
send "%{CooldownCheck_%loop-value%::%player%}%" to player
wait 5 ticks
loop {AllCooldowns::*}:
if {%loop-value%::%player%} is not less than "%{CooldownCheck_%loop-value%::%player%}%": # This is the broken part :/
send "%loop-value%: %{%loop-value%::%player%}%" to player # The sends are for me to monitor
set {%loop-value%::%player%} to 0
send "check: %{CooldownCheck_%loop-value%::%player%}%" to player
clear {CooldownCheck_%loop-value%::%player%}
else:
send "Check: %{CooldownCheck_%loop-value%::%player%}%" to player
send "Loop Value: %{%loop-value%::%player%}%" to player
clear {CooldownCheck_%loop-value%::%player%}