Variable Help?

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

QmanRocks

New Member
Aug 2, 2021
7
0
1
16
I'm trying to code a feature where when you click a sign with certain text on it, you will purchase a rank (if you have enough money).
Code:
on rightclick on sign:
    if line 2 is "Plus Rank":
        set {_balance} to value of placeholder "vault_eco_balance_fixed" from player
        set {%player%.rank} to value of placeholder "vault_rank" from player
        if {%player%.rank} is "default":
            if {_balance} is greater than 174:
                make console execute command "/lp user %{playername}% parent set plus"
                send "Successfully purchased Plus Rank!"
                make console execute command "/eco take %player% 175"
            else:
                if {_balance} is less than 175:
                    send "&cYou don't have enough Gems!" to player
                else:
                    send "%{_balance}%" to player <
        else:
            send "&cYou already have a better rank! All of the stuff from the previous ranks pass over." to player
I'm using a plugin to import Placeholders from PlaceholderAPI, and if I test out the placeholder for balance, it registers as $350. But, the code doesn't give me the rank. It instead goes to where the < symbol is. I don't know why the code isn't working, but I feel like it isn't recognizing {_balance} as an integer. Any help would be amazing!
 
use player's balance expression, you can add or subtract from it
 
Status
Not open for further replies.