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.

Variable Help?

Discussion in 'Skript' started by QmanRocks, Jan 25, 2022.

Thread Status:
Not open for further replies.
  1. QmanRocks

    QmanRocks New Member

    Joined:
    Aug 2, 2021
    Messages:
    6
    Likes Received:
    0
    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 (Text):
    1. on rightclick on sign:
    2.     if line 2 is "Plus Rank":
    3.         set {_balance} to value of placeholder "vault_eco_balance_fixed" from player
    4.         set {%player%.rank} to value of placeholder "vault_rank" from player
    5.         if {%player%.rank} is "default":
    6.             if {_balance} is greater than 174:
    7.                 make console execute command "/lp user %{playername}% parent set plus"
    8.                 send "Successfully purchased Plus Rank!"
    9.                 make console execute command "/eco take %player% 175"
    10.             else:
    11.                 if {_balance} is less than 175:
    12.                     send "&cYou don't have enough Gems!" to player
    13.                 else:
    14.                     send "%{_balance}%" to player <
    15.         else:
    16.             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!
     
  2. Tenfont

    Tenfont Member

    Joined:
    Mar 28, 2021
    Messages:
    24
    Likes Received:
    2
    use player's balance expression, you can add or subtract from it
     
Thread Status:
Not open for further replies.

Share This Page

Loading...