Hi,
I just started skripting so pardon if the code itself is absolute garbage. Im having trouble converting one of my strings (in this case my essentials economy balance) to an integer (So instead of $6,520 ill have 6250). This is so I can compare it to another string (of which I convert to an integer right after I convert the first string). In the end, I want to make sure the balance ism greater than or equal to the bet. I have pasted my code below. I get an error as well saying I cannot remove the elements ($ and ,) from the first string. Any help is greatly appreciated! Please lmk if you need any clarification.
I just started skripting so pardon if the code itself is absolute garbage. Im having trouble converting one of my strings (in this case my essentials economy balance) to an integer (So instead of $6,520 ill have 6250). This is so I can compare it to another string (of which I convert to an integer right after I convert the first string). In the end, I want to make sure the balance ism greater than or equal to the bet. I have pasted my code below. I get an error as well saying I cannot remove the elements ($ and ,) from the first string. Any help is greatly appreciated! Please lmk if you need any clarification.
Code:
Command /rps [<text>]:
trigger:
if arg 1 is not set:
send "&4Please Define a Bet! /rps <bet>" to player
if arg 1 is set:
set {_bet,%player%} to arg 1
set {_bal,%player%} to balance of player
send "Bet: %{_bet,%player%}%" to player
send "Balance: %{_bal,%player%}%" to player
replace all "$" in "%{_bal,%player%}%" with ""
replace all "," in "%{_bal,%player%}%" with ""
set {_newbal,%player%} to {_bal,%player%} parsed as an integer
set {_newbet,%player%} to {_bet,%player%} parsed as an integer
if {_newbal,%player%} is greater than or equal to {_newbet,%player%}:
send "Placeholder... To be added later." to player
if {_newbal,%player%} is less than {_newbet,%player%}:
broadcast "You don't have enough money!"
else:
broadcast "Please enter in a valid number."