command /x:
permission: op
trigger:
give player end rod named "&6&lRóżczka lewitacjii"
on right click with end rod:
name of player's tool is "&6&lRóżczka lewitacjii"
dajCD(player, "lewtiacja", "&3[Lewitacja]&7 Przed następnym użyciem poczekaj&7", 60 seconds) = true
loop all players in radius 5 blocks of player:
apply levitation to loop-player for 5 seconds
function dajCD(p: player, v: text, t: text, s: timespan) :: boolean:
if difference between {cooldown::%{_v}%::%{_p}%} and now is smaller than {_s}:
remove difference between now and {cooldown::%{_v}%::%{_p}%} from {_s}
set {_s} to "%{_s}%"
replace all "seconds" and "second" with "s" in {_s}
replace all "minute" and "minutes" with "m" in {_s}
send "%{_t}% %{_s}%" to {_p}
return false
else:
set {cooldown::%{_v}%::%{_p}%} to now
return true
powinno dzialac