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 Check balance

Discussion in 'Skript' started by Mitto113, Mar 24, 2020 at 8:53 PM.

  1. Mitto113

    Mitto113 Member

    Joined:
    Tuesday
    Messages:
    1
    Likes Received:
    0
    Hello,


    I can't figure out why this doesn't work as I get no error when reloading it

    This is an example of what the code is since my entire script doesn't matter




    This is the one I have a problem with
    Code (Text):
    1. if player's balance is less than {ssp-money::%player's uuid%}:
    {ssp-money::%player's uuid%} is set this way

    Code (Text):
    1.  
    2. command /test [<text>]:
    3.     trigger:
    4.         set {ssp-money::%uuid of player%} to "%(arg-1 parsed as num)%"
    5.  
    hope someone knows what bugs are here or a solution to it
     
  2. Best Answer:
    Post #2 by couger44, Mar 25, 2020 at 10:24 PM
  3. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    436
    Likes Received:
    14
    When you go to work with numbers in skript, you can't use quotes because skript thinks that you are working with a text instead of numbers.

    This should solve your problem:

    Code (Skript):
    1.  
    2. command /test [<int>]:
    3.     trigger:
    4.         set {ssp-money::%uuid of player%} to arg 1
    5.  
    A variant of this code could be:

    Code (Skript):
    1.  
    2. command /test [<text>]:
    3.     trigger:
    4.         set {ssp-money::%uuid of player%} arg 1 parsed as integer
    5.  
    Doing this you can use:

    Code (Skript):
    1. if player's balance < {ssp-money::%uuid of player%}:
    EDIT: I recommend using '<', '=' and '>' instead of "less", "equal" and "greater". It is much simpler.
     
    #2 couger44, Mar 25, 2020 at 10:24 PM
    Last edited: Mar 25, 2020 at 10:30 PM
Loading...