Solved Weird if statment issue with less than and greater than.

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

    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.

Sumann

Member
Feb 16, 2021
1
0
1
Im creating a skript that enables the purchase of a efficiency upgrade to your pickaxe.
Code:
command /efficiencyupone:
    aliases: /effupone, /efficiencyupgradeone
    trigger:
        if player is holding a pickaxe:
            if {_playerbal} is greater than {_price}:    # playerbal and price are preset integers, if you take away price from playbal it works.
                set {_lev} to efficiency level of player's tool + 1
                enchant player's tool with "efficiency %{_lev}%" parsed as enchantment type
                execute console command "eco take %player% %{_price}%"
                
            else:
                if {_playerbal} is less than {_price}:
                    send "You need $%{_price}-{_playerbal}% for this upgrade."
                else:
                    send "&4Error"     # i always get this &4error send no matter the amount of balance i have.
        else:
            send "You need to hold a pickaxe."
Everything in this skript code works individually, however, when put together the result no matter the price and the playerbal it's always error. The playerbal and price variables are simple integers. I believe the problem lies in my if statements but I have no idea. Any ideas on a why this is happening and how I can fix it would be appreciated.
Additional information: Skript Version 2.5.3 Addons: SKQuery V4.1.4
 
Status
Not open for further replies.