Im creating a skript that enables the purchase of a efficiency upgrade to your 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
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."
Additional information: Skript Version 2.5.3 Addons: SKQuery V4.1.4