Set argument to a variable

Discussion in 'Skript' started by KroterPvP, Apr 28, 2017.

  1. Hello. I want to set an argument to a variable:
    Code (Text):
            if arg 1 is "getcash":
                if arg 2 is set:
                    set {seconomy.getcash.%player%} to %arg 2%
                    if {seconomy.economy.%player%} > {seconomy.getcash.%player%}:
                        remove {seconomy.getcash.%player%} from {seconomy.economy.%player%}
                        drop 175 named "&e{seconomy.getcash.%player%} &7coins" at location of player
                        send "&7You have cashed &e%{seconomy.getcash.%player%}% &7coins." to player
    # {seconomy.economy.%player%} is writed in another part of the skript.
     
    Te variable {seconomy.getcash.%player%} doesn't change to %arg 2%. Can anybody help me?
    I have only pasted a part of the skript, so the first part isn't shown here.
     
  2. Try removing the %'s in it.
     
  3. Yes, It's fiexed now, but it doesn't run.
    Code (Text):
            if arg 1 is "getcash":
                if arg 2 is set:
                    set {seconomy.getcash.%player%} to arg 2
                    if {seconomy.economy.%player%} > {seconomy.getcash.%player%}:
                        remove {seconomy.getcash.%player%} from {seconomy.economy.%player%}
                        drop 175 named "&e{seconomy.getcash.%player%} &7coins" at location of player
                        send "&7You have cashed &e%{seconomy.getcash.%player%}% &7coins." to player
                    else if {seconomy.economy.%player%} = {seconomy.getcash.%player%}:
                        remove {seconomy.getcash.%player%} from {seconomy.economy.%player%}
                        drop 175 named "&e{seconomy.getcash.%player%} &7coins" at location of player
                        send "&7You have cashed &e%{seconomy.getcash.%player%}% &7coins." to player
                    else if {seconomy.economy.%player%} < {seconomy.getcash.%player%}:
                        send "&7You don't have enought coins! (&e%{seconomy.economy.%player%}%&7)" to player
     
  4. set {seconomy.getcash.%player%} to "%arg 2%"
     
    • Agree Agree x 1
  5. https://forums.skunity.com Next time make a skript thread here if you want to get responded quickly.
     
  6. thanks. Do you know a skript online chat to get help?