Solved Economy Command not Working

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Colorlot

Member
Nov 18, 2018
4
0
0
26
Hello, I am making a skript to replace Essentials. When I try to make an economy command I don't want my staff to set a players balance to $hjsthwert or anything like that, so I did

if arg 3 is not a number:
send "&c&lCUSTOM ESSENTIALS &7Please provide a valid number!"

but now, even when I put a number, it tells me to provide a valid number
 
You're going to have to show your command here.
You can set the argument types, so you don't need to conditionally check them later
 
command /economy <offline player> <text>:
aliases: /skeconomy, /skeco, /eco
permission: essentials.vanish
permission message: "&c&lCUSTOM ESSENTIALS &7You may not run this command!"
trigger:
if arg 2 is not a number:
send "&c&lCUSTOM ESSENTIALS &7You must provide a valid number!"
else:
set {economy.%arg-1%.balance} to arg 2


there are tabs/spaces, just didn't go into the message
[doublepost=1542861130,1542860902][/doublepost]but when I put numbers, it says I must provide a valid number
 
command /economy <offline player> <text>:
aliases: /skeconomy, /skeco, /eco
permission: essentials.vanish
permission message: "&c&lCUSTOM ESSENTIALS &7You may not run this command!"
trigger:
if arg 2 is not a number:
send "&c&lCUSTOM ESSENTIALS &7You must provide a valid number!"
else:
set {economy.%arg-1%.balance} to arg 2


there are tabs/spaces, just didn't go into the message
[doublepost=1542861130,1542860902][/doublepost]but when I put numbers, it says I must provide a valid number
Use <number> instead of <text>. Also use CODE tags to make it easier to read next time.
EDIT:
If you want players to be able to use $ in front of it, use this:
code_language.skript:
command /economy <offline player> <text>:
    aliases: /skeconomy, /skeco, /eco
    permission: essentials.vanish
    permission message: "&c&lCUSTOM ESSENTIALS &7You may not run this command!"
    trigger:
        set {_t::*} to arg-2 parsed as "[$]%number%"
        set {_arg-2} to {_t::1}
        if {_t::*} is not set:
            send "&c&lCUSTOM ESSENTIALS &7You must provide a valid number!"
        else:
            set {economy.%arg-1%.balance} to {_arg-2}
 
Last edited:
Status
Not open for further replies.