1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Economy Command not Working

Discussion in 'Skript' started by Colorlot, Nov 22, 2018.

Thread Status:
Not open for further replies.
  1. Colorlot

    Colorlot Member

    Joined:
    Nov 18, 2018
    Messages:
    4
    Likes Received:
    0
    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


     
  2. Best Answer:
    Post #4 by TPGamesNL, Nov 22, 2018
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    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
     
  4. Colorlot

    Colorlot Member

    Joined:
    Nov 18, 2018
    Messages:
    4
    Likes Received:
    0
    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
    --- Double Post Merged, Nov 22, 2018, Original Post Date: Nov 22, 2018 ---
    but when I put numbers, it says I must provide a valid number
     
  5. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    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 (Skript):
    1. command /economy <offline player> <text>:
    2.     aliases: /skeconomy, /skeco, /eco
    3.     permission: essentials.vanish
    4.     permission message: "&c&lCUSTOM ESSENTIALS &7You may not run this command!"
    5.     trigger:
    6.         set {_t::*} to arg-2 parsed as "[$]%number%"
    7.         set {_arg-2} to {_t::1}
    8.         if {_t::*} is not set:
    9.             send "&c&lCUSTOM ESSENTIALS &7You must provide a valid number!"
    10.         else:
    11.             set {economy.%arg-1%.balance} to {_arg-2}
     
    #4 TPGamesNL, Nov 22, 2018
    Last edited: Nov 22, 2018
    • Agree Agree x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...