Economy Reset

  • 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 community!

    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!

Harty0012345

Member
Jul 6, 2023
12
1
3
Hello again,
I am trying to make an economy skript for my server,
But it comes out with an error
1692174991838.png

My code is
command /eco [<text>] [<player>] [<number>]:
permission: eco.admin
trigger:
if %arg-1% is "reset":
if %arg-2% is empty:
send "&cError: You must include a player name!"
else:
set {balance::%player%} to 0

Thank you!
 
You don't need to use percent signs outside of quotes. You can just do if arg = "reset":
 
I have another error now,
When I do /balance it shows the variable and not my balance
1692195100421.png

Code is:
command /balance:
trigger:
send "&aYour currency is: ${balance::%player%}"
 
I have another error now,
When I do /balance it shows the variable and not my balance
View attachment 7735
Code is:
command /balance:
trigger:
send "&aYour currency is: ${balance::%player%}"
Ahem
Do you not know basics of skript he literally said you don’t need % outside of quotation marks (“)
And what do you do? Remove the % inside of quotation marks
 
Hey, I was just looking at your skript. I think it is good but I made some changes to your skript down below that I think you might like. Just make sure you keep close attention on where you are using % signs!

Code:
# =================== Code ============================

function eco(p: player, t: text, n: number):
    if {_t} is "reset":
        send "&cCleared your balance" to {_p}
        set {balance::%{_p}%} to 0
    if {_n} is greater than 0:
        if {_t} is "give":
            send "&e%{_p}% &a$%{_n}% has just been added to your balance" to {_p} # adding message
            add {_n} to {balance::%{_p}%}
        if {_t} is "remove":
            send "&e%{_p}% &c$%{_n}% has been removed from your balance" to {_p} # removing message
            remove {_n} from {balance::%{_p}%}
        if {_t} is "set":
            set {balance::%{_p}%} to {_n}
            send "&e%{_p}% &3Your balance has just been set to $%{balance::%{_p}%}%" to {_p} # setting message
  
command /eco [<player>] [<text>] [<number>]: # PLAYER -- # reset/give/remove/set -- # amount
    trigger:
        if arg-1 is set:
            if arg-3 is set:
                eco(arg-1, arg-2, arg-3)
                stop
            if arg-2 is set:
                eco(arg-1, arg-2, 0)
                stop
          
command /balance:
    trigger:
        send "Your balance is: %{balance::%player%}%" to player

# ======================== ============================

Try this out and see if its good or not!
I'm not fully sure on what you are wanting fully, but here is what I came up with!
 
Last edited: