Hello everyone
I'm trying to make a "kitadder" script. the thing that's really hard for me, is that I can't make a different cooldown for each kit.
The code is a little messy, I know... I will fix it when I find out how to set different cooldowns!
The problems are here:
if {_waited} is less than {cooldown.kit.%arg-1%} seconds:
message "You have to wait %difference between {cooldown.kit.%arg-1%} seconds and {_waited}% before you can use this command again!"
set {cooldown.kit.%arg-1%} to arg-2 parsed as a timespan
I'm trying to make a "kitadder" script. the thing that's really hard for me, is that I can't make a different cooldown for each kit.
The code is a little messy, I know... I will fix it when I find out how to set different cooldowns!
Code:
command /showinv [<text>]:
trigger:
if {stuff:%arg-1%::*} exists:
if player has permission "aeskits.%arg-1%":
set {_waited} to difference between {%arg-1%.%player's uuid%.lastused} and now
if {_waited} is less than {cooldown.kit.%arg-1%} seconds:
message "You have to wait %difference between {cooldown.kit.%arg-1%} seconds and {_waited}% before you can use this command again!"
stop
set {_slot} to -1
loop {stuff:%arg-1%::*}:
add 1 to {_slot}
give player loop-value
set {%arg-1%.%player's uuid%.lastused} to now
else:
send "Det kit findes ikke?"
command /testnu [<text>]:
trigger:
send "%{cooldown.kit.%arg-1%}%"
command /saveinv [<text>] [<number>]:
trigger:
loop all items in player's inventory:
add loop-item to {stuff:%arg-1%::*}
send "&a&l[✓] &fSaved &7&o%size of {stuff:%arg-1%::*}%&r&f items."
add arg-1 to {ag.itemframechest::*}
set {cooldown.kit.%arg-1%} to arg-2 parsed as a timespan
command /kits:
trigger:
loop {ag.itemframechest::*}:
send "%loop-value%" to player
The problems are here:
if {_waited} is less than {cooldown.kit.%arg-1%} seconds:
message "You have to wait %difference between {cooldown.kit.%arg-1%} seconds and {_waited}% before you can use this command again!"
set {cooldown.kit.%arg-1%} to arg-2 parsed as a timespan