Economy

Discussion in 'Skript' started by Trickboost, Aug 10, 2018.

Thread Status:
Not open for further replies.
  1. Hey, i'm trying to make an enconomy plugin with skript and i am having troubles.
    What i'm trying to do is that if the executor %player% do not have the enough amount of money that he is trying to give, the server would cancel the transaccion.


    Code (Text):
    command /pay [<player>] [<number>]:
      trigger:
        if arg 1 is not set:
          message "&a/pay <player> <amount>"
        if arg 1 is set:
          if arg 2 is not set:
            message "&a/pay <player> <amount>"
          if arg 2 is set:
            if {balance.%player%} is < %arg-2%:
              message "&aYou don't have enough money!"
     
    This is what i've done and the server says
    Can anyone help me please?
     
    #1 Trickboost, Aug 10, 2018
    Last edited: Aug 10, 2018
  2. use
    Code (Text):
    if {balance.%player%} < arg-2:
     
    • Agree Agree x 1
  3. Doesn't work
     
  4. Any errors or what?
     
  5. The same error as before
     
  6. Can you please send your current code in code tags?
     
  7. This is the code
    Code (Text):
    command /pay [<player>] [<number>]:
      trigger:
        if arg 1 is not set:
          message "&a/pay <player> <amount>"
        if arg 1 is set:
          if arg 2 is not set:
            message "&a/pay <player> <amount>"
          if arg 2 is set:
            if {balance.%player%} < %arg-2%:
              message "&aYou don't have enough money"
    And this is the error
    Code (Text):
    can't understand this condition: '{balance.%player%} < %arg-2%'
     
    #7 Trickboost, Aug 10, 2018
    Last edited: Aug 10, 2018
  8. Code (Text):
    command /pay [<player>] [<number>]:
        trigger:
            if arg 1 is not set:
                message "&a/pay <player> <amount>"
            if arg 1 is set:
                if arg 2 is not set:
                    message "&a/pay <player> <amount>"
                if arg 2 is set:
                    if {balance.%player%} < arg-2:
                        message "&aYou don't have enough money"
     
    • Agree Agree x 1
  9. Also if that doesn't work try using "is less than" instead of < (I know they are the same thing but I have never used < and maybe that could be the problem)
     
  10. If you've never used < and >, I highly recommend doing so as it's much easier to read and type. It's also used in other programming languages. https://skriptlang.github.io/Skript/conditions.html#CondCompare
     
  11. I personally have a lot of problems understanding which means higher and which means less out of < > xD so not really easier to read
     
  12. > means higher than and < means lower than. Sometimes I even see people use "is equal to" when you can use is / = and I think the last two are much easier.
     
  13. U need to use => (greater than or equal to)
     
  14. >=
     
  15. Woops XD
    forgot about that
     
Thread Status:
Not open for further replies.

Share This Page