Solved FFA Money System

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

Status
Not open for further replies.

07L

Member
Feb 23, 2019
43
0
0
For some reason this is only displaying 0. Even when adding coins. Any help?

Code:
command /money:
    aliases: /coins
    trigger:
        if {ffajoin.%player%} is true:
            send message "{@prefix} &7You have &c%{ffacoins.%player%}% &7coins."
        else:
            send message "{@unknown}"

command /ffacoins [<text>] [<offline player>] [<text>]:
    trigger:
        if {ffajoin.%player%} is true:
            if player has permission "ffa.coins":
                if arg-1 is not set:
                    send message "&8&m-------------------------"
                    send message "&7[&6FFA&7] &4COINS"
                    send message ""
                    send message "&4/ffacoins add {player} {amount} &7- &aGive a player's coins"
                    send message "&4/ffacoins take {player} {amount} &7- &aTake a player's coins"
                    send message "&4/ffaadmin reset {player} &7- &aReset a player's coins"
                    send message ""
                    send message "&8&m-------------------------"
                else if arg-1 is "add":
                    if arg-2 is not set:
                        send message "{@prefix} &cIncorrect Usage! &4/ffacoins add {player} {amount}"
                    if arg-2 is set:
                        if arg-2 has played on this server before:
                            if arg-3 is not set:
                                send message "{@prefix} &cIncorrect Usage! &4/ffacoins add {player} {amount}"
                            if arg-3 is set:
                                if (arg-3 parsed as num) is set:
                                    subtract arg-3 from {ffacoins.%arg-2%}
                                    send message "{@prefix} &7Successfully added &c%arg-3% &7to &6%arg-2%'s &7coins!"
                                else:
                                    send message "{@prefix} &cIncorrect Usage! You must specify a number to add."
                        if arg-2 has not played before:
                            send message "{@prefix} &7%arg-2% &chas never connected!"
                else if arg-1 is "take":
                    if arg-2 is not set:
                        send message "{@prefix} &cIncorrect Usage! &4/ffacoins take {player} {amount}"
                    if arg-2 is set:
                        if arg-2 has played on this server before:
                            if arg-3 is not set:
                                send message "{@prefix} &cIncorrect Usage! &4/ffacoins take {player} {amount}"
                            if arg-3 is set:
                                if (arg-3 parsed as num) is set:
                                    add arg-3 to {ffacoins.%arg-2%}
                                    send message "{@prefix} &7Successfully took &c%arg-3% &7from &6%arg-2%'s coins"
                                else:
                                    send message "{@prefix} &cIncorrect Usage! You must specify a number to take."
                        if arg-2 has not played before:
                            send message "{@prefix} &7%arg-2% &chas never connected!"
                else if arg-1 is "reset":
                    if arg-2 is not set:
                        send message "{@prefix} &cIncorrect Usage! &4/ffacoins reset {player}"
                    if arg-2 is set:
                        if arg-2 has played on this server before:
                            set {ffacoins.%player%} to 0
                            send message "{@prefix} &6%arg-2%'s &ccoins have been reset!"
                        if arg-2 has not played before:
                            send message "{@prefix} &7%arg-2% &chas never connected!"
                else:
                    send message "{@unknown}"
            else:
                send message "{@unknown}"
        else:
            send message "{@unknown}"
 
Last edited:
You have to use arg-3 parsed as a number, because you can't add a text to a number
 
Yes, but you have to set a temporary variable to arg-3 parsed as a number, because what you're using now only checks if it can be parsed as a number, it won't set arg-3 to a number
 
Yes, but you have to set a temporary variable to arg-3 parsed as a number, because what you're using now only checks if it can be parsed as a number, it won't set arg-3 to a number
so can I just do
Code:
if (arg-3 parsed as a number) is set:
    arg-3=number
 
No, more like set {_variable} to arg-3 parsed as a number. Then use that variable to add to the coin variable
 
Status
Not open for further replies.