Solved Convert text to numbers

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

KrswtkhrSK

Member
Jan 28, 2017
27
2
1
https://forums.skunity.com/threads/store-the-first-row-of-lore.4303/
Thank you so much for answering my questions!


Sorry to bother you again.

I could store diamond sword Lore safely, so I tried the calculation.

Then, how can you convert the cut Lore to a number?
I cut out the character code "&a", but it looks like text.

code_language.skript:
#give 1 diamond sword named "test" with lore "&a100" to {_p}
on rightclick holding diamond sword:
  set {_firstline} to first element out of split lore of player's tool at "||"
  set {rawlore::*} to {_firstline} split at "&a"
 
  broadcast "%{rawlore::2} + {rawlore::2}%"
  add {rawlore::2} to the player's account

In this case, the calculation result will be 0 or money will not be added...
[doublepost=1499246408,1499245246][/doublepost]Oh, I solved my self:emoji_astonished:
code_language.skript:
set {rawlore} to {rawlore::2} parsed as integer
 
Status
Not open for further replies.