Solved Check balance

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

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

Mitto113

Member
Mar 24, 2020
1
0
0
24
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:
if player's balance is less than {ssp-money::%player's uuid%}:

{ssp-money::%player's uuid%} is set this way

Code:
command /test [<text>]:
    trigger:
        set {ssp-money::%uuid of player%} to "%(arg-1 parsed as num)%"

hope someone knows what bugs are here or a solution to it
 
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:
if player's balance is less than {ssp-money::%player's uuid%}:

{ssp-money::%player's uuid%} is set this way

Code:
command /test [<text>]:
    trigger:
        set {ssp-money::%uuid of player%} to "%(arg-1 parsed as num)%"

hope someone knows what bugs are here or a solution to it
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_language.skript:
command /test [<int>]:
    trigger:
        set {ssp-money::%uuid of player%} to arg 1

A variant of this code could be:

code_language.skript:
command /test [<text>]:
    trigger:
        set {ssp-money::%uuid of player%} arg 1 parsed as integer

Doing this you can use:

code_language.skript:
if player's balance < {ssp-money::%uuid of player%}:

EDIT: I recommend using '<', '=' and '>' instead of "less", "equal" and "greater". It is much simpler.
 
Last edited:
Status
Not open for further replies.