I'm trying to make it so you can see the time you must wait to use a command again. I understand that you can use "cooldownmessage:" and %remaining time% for that, but it shows 2 decimal places. I want it to only show whole seconds. Here is the code that I tried. I cannot figure out why it does not work. That is what I need help with.
every second in "world":
loop {timecooldown::*}:
if {timecooldown::%loop-index%} is greater than 0:
subtract 1 from {timecooldown::%loop-index%}
command /time:
trigger:
if {timecooldown::*} does not contain {%player%.timecooldown}:
add {%player%.timecooldown} to {timecooldown::*}
if {timecooldownlist::%player%.timecooldown} is not set:
set {timecooldownlist::%player%.timecooldown} to 0
if {timecooldownlist::%player%.timecooldown} is 0:
set {timecooldownlist::%player%.timecooldown} to 40
message "you did it" to player
else:
message "wait %{%player%.timecooldown}% seconds" to player
every second in "world":
loop {timecooldown::*}:
if {timecooldown::%loop-index%} is greater than 0:
subtract 1 from {timecooldown::%loop-index%}
command /time:
trigger:
if {timecooldown::*} does not contain {%player%.timecooldown}:
add {%player%.timecooldown} to {timecooldown::*}
if {timecooldownlist::%player%.timecooldown} is not set:
set {timecooldownlist::%player%.timecooldown} to 0
if {timecooldownlist::%player%.timecooldown} is 0:
set {timecooldownlist::%player%.timecooldown} to 40
message "you did it" to player
else:
message "wait %{%player%.timecooldown}% seconds" to player