Comme sa ?si c'est sa fonctionne pas
options:
Cooldown: 24 hours
function KeyDelay(difference: timespan, KeyDelay: timespan) :: text:
remove {_difference} from {_KeyDelay}
set {_KeyDelay} to "%{_KeyDelay}%"
set {_sp::*} to {_KeyDelay} split at " "
{_sp::5} is set:
set {_sp::1} to rounded down {_sp::1} parsed as a number
set {_sp::4} to rounded down {_sp::4} parsed as a number
set {_result} to "%{_sp::1}% %{_sp::2}% et %{_sp::4}% %{_sp::5}%"
else:
set {_sp::1} to rounded down {_sp::1} parsed as a number
set {_result} to "%{_sp::1}% %{_sp::2}%"
replace "second " with "secondee " in {_result}
replace "seconds" with "secondes" in {_result}
replace "minute " with "minute " in {_result}
replace "minutes" with "minutes" in {_result}
replace "hour " with "heure " in {_result}
replace "hours" with "heures" in {_result}
replace "day " with "jour " in {_result}
replace "days" with "jours" in {_result}
return {_result}
command /key:
trigger:
set {_KeyDelay} to difference between {KeyDelay.%player%.commande} and now
if {_KeyDelay} is less than {@Cooldown}:
set {_KeyDelay} to Attente(difference between {KeyDelay.%player%.commande} and now, {@Cooldown})
message "&c> Tu as déjà récupéré ta clef ! Revient dans %{_KeyDelay}%&c."
else:
set {KeyDelay.%player%.commande} to now
message "&a> Une clef a été ajouté à votre inventaire !"
message "&e> Vous venez de recevoir une clé"
execute console command "/crate gk %player% AuraliteBox 1"