Player's Money not comparable to integer.

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

FlintSH

Member
Apr 8, 2020
2
0
0
34
I need help, this is driving me nuts.

I have no idea why my conditionals aren't working. Balance is not comparable to an integer for whatever reason.
Please help. The only addon I use is skRayFall

Code:
command /buyanchor:
    trigger:
        if player's balance is <= 50000.00:
            execute console command "ea give %player% 1"
            take 50000 from the player's balance
        else if player's balance is > 50000.00:
            send "&bNebula&3MC &6>> &aYou need &c$50,000 &ato buy an anchor!"
 
This may work:
Code:
command /buyanchor:
    trigger:
        set {balance.%player%} to player's balance
        if {balance.%player%} is <= 50000.00:
            execute console command "ea give %player% 1"
            take 50000 from the player's balance
        else if {balance.%player%} is > 50000.00:
            send "&bNebula&3MC &6>> &aYou need &c$50,000 &ato buy an anchor!"
 
This may work:
Code:
command /buyanchor:
    trigger:
        set {balance.%player%} to player's balance
        if {balance.%player%} is <= 50000.00:
            execute console command "ea give %player% 1"
            take 50000 from the player's balance
        else if {balance.%player%} is > 50000.00:
            send "&bNebula&3MC &6>> &aYou need &c$50,000 &ato buy an anchor!"
Unfortunately did not work.
The problem is that player's balance is being recognized as a string, when output to chat it's being sent as: $x,xxx if that makes sense, its not being recognized an integer.
 
Unfortunately did not work.
The problem is that player's balance is being recognized as a string, when output to chat it's being sent as: $x,xxx if that makes sense, its not being recognized an integer.
Try getting SkQuery
 
Try this:
Code:
command /buyanchor:
    trigger:
        if player's balance >= 50000:
            execute console command "ea give %player% 1"
            remove 50000 from player's balance
        else if player's balance < 50000:
            send "&bNebula&3MC &6>> &aYou need &c$50,000 &ato buy an anchor!"
 
Status
Not open for further replies.