Solved Setting a variable question

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

dudle

Active Member
Jan 31, 2017
135
0
16
Hi,

I want to set a variable {example.variable} to {variable2::*}. Is it possible to make this considering that the {variable2::*} has only 1 object in it, which is a number? Any ways of doing this?
 
Loop {variable2::*}:
"%loop-value%" is a number:
set {example.variable} to "%loop-value%"

Is it that, what you mean?
 
Loop {variable2::*}:
"%loop-value%" is a number:
set {example.variable} to "%loop-value%"

Is it that, what you mean?
That wont work because your checking if a string is a number which will never be true

If you know the index of the value that was added then you can do:
code_language.skript:
set {var} to {var2::index}
 
No Problem. :emoji_slight_smile:
[doublepost=1511123812,1511123736][/doublepost]
That wont work because your checking if a string is a number which will never be true

If you know the index of the value that was added then you can do:
code_language.skript:
set {var} to {var2::index}
This works on my server.
 
if you remove the quotes it will work but right now this is what you have and always broadcasts 'no'
code_language.skript:
command /test:
    trigger:
        if "2" is a number:
            broadcast "yes"
        else:
            broadcast "no"
 
Status
Not open for further replies.