Okay, so I have a money changer script where if you type in /changemoney it will change the players money.
BUT if someone types in /changemoney Name Lol, it will mess up the script and will give <none> to the player.
How can i block this so they can only put in numbers in like
1,2,3...
Here is my script
BUT if someone types in /changemoney Name Lol, it will mess up the script and will give <none> to the player.
How can i block this so they can only put in numbers in like
1,2,3...
Here is my script
code_language.skript:
command /changemoney [<offline player>] [<text>]:
permission: money.set
permission message: Not allowed!
trigger:
arg 1 is set:
arg 2 is set:
set {_num} to arg-2 parsed as an integer
if arg 1 is online:
if arg 1 is player:
send "You can't change YOUR money"
stop
difference between {sql_.diff.setmoney::%player%} and now is less than 30 seconds:
send "Cooldown"
stop
if {_num} is greater than 500000:
send "too high"
stop
set {sql_.diff.setmoney::%player%} to now
{@run_async} is "true":
$ thread
set {_message} to addmoney(arg 1, {_num}, 1)
send "worked!"
send arg-1 title "Money!!" with subtitle "&bYou now have %{_num}%" for 3 seconds
else:
send "player offline"
else:
send "wrong usage"
else:
send "wrong usage"