Solved How to convert text to integer or number

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

    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.

Martini002

Member
Feb 17, 2017
36
0
0
40
Hello,

I have this:
code_language.skript:
command /test2 <text>:
  trigger:
    set {_CP} to {arg-2} / 2
    message "%{_CP}%"

Output = 0

If I use integer or number instead of text in the argument, then it works.
But I need use it as text, how can I do that?
 
The argument isn't a variable, it's an expression, you don't have to surround it with braces (and it's arg-1 such as there isn't a second one). And you can use the parse expression for that.
 
Status
Not open for further replies.