Balance without Symbol?

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

LandonPlayz

New Member
Feb 18, 2017
8
0
0
QUESTION: Is there any way to get the balance of a player without the currency symbol. I don't care if I need an addon to do it.
 
Just parse it as a number? Something like this should work:
code_language.skript:
set {_balance} to first element of ("%balance of player%") parsed as "%number%$"
You can use the following function to make it a bit cleaner:
code_language.skript:
function getBalance(player: player) :: number:

  set {_balance} to balance of {_player}
  set {_amount::*} to {_balance} parsed as "%number%$"

  return {_amount::1}
 
Last edited by a moderator:
If you don't need the symbol at all, you can remove it in the essentials main config.
 
If you don't need the symbol at all, you can remove it in the essentials main config.
I only don't need it for this skript
[doublepost=1501557060,1501556989][/doublepost]
Just parse it as a number? Something like this should work:
code_language.skript:
set {_balance} to first element of ("%balance of player%") parsed as "%number%$"
1c211466a3cd627525851c0930445e6f.png
 
I only don't need it for this skript
[doublepost=1501557060,1501556989][/doublepost]
1c211466a3cd627525851c0930445e6f.png
I edited the post, tey it using the above function or split it up into separate lines as I did (although surrounding the part from the word after "first element of" and the final word with parentheses will work). Also, don't remove the "$" or it will not work.
 
I edited the post, tey it using the above function or split it up into separate lines as I did (although surrounding the part from the word after "first element of" and the final word with parentheses will work). Also, don't remove the "$" or it will not work.
but I DON'T need the $
 
I know, the parse expression takes that format and only extracts the number from it, everything else is removed.
it still says the same thing with it can only be set with one thing.

just put the EXACT thing I need to put (not the function one)
 
it still says the same thing with it can only be set with one thing.

just put the EXACT thing I need to put (not the function one)
Could you show me that part of the code? It should look like this:
code_language.skript:
set {_balance} to "%balance of loop-value%"
set  {_amount::*} to {_balance} parsed as "%number%$"
#{_amount::1} should be it.
 
code_language.skript:
            set {balance::%loop-value%} to "%balance of loop-value%"
            set {_amount::*} to {balance::%loop-value%} parsed as "%number%$"
            format slot {_topnumber} of player with a stone named "%{_topnumber}%. %loop-value%" with lore "money: &a%{_amount::1}%" to be unstealable

It comes back like this:

money: <none>
[doublepost=1501596498,1501558225][/doublepost]
If you don't need the symbol at all, you can remove it in the essentials main config.
how?
[doublepost=1501596553][/doublepost]
If you don't need the symbol at all, you can remove it in the essentials main config.
Nevermind.
 
Status
Not open for further replies.