How to get these values?

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

pepper82

Member
Jan 26, 2017
272
1
18
41
code_language.skript:
command /testlist:
    trigger:
        set {_t1} to "test4"
        set {_t2} to "test4"
        set {_t3} to "test4"
        add {_t1} to {_test::*}
        add {_t2} to {_test::*}
        add {_t3} to {_test::*}
        set {_test::%{_t1}%::id} to "id1"
        set {_test::%{_t2}%::id} to "id2"
        set {_test::%{_t3}%::id} to "id3"
        loop {_test::*}:
            message "%{_test::%loop-value%::id}%"

result is always:
id3
id3
id3

What am I doing wrong?
How could I get all the values (id1,id2,id3) ?
Shouldn't Skript loop all entries in the list???
 
You're actually doing this:
code_language.skript:
{_test::%value of {_t1}%::id} > {_test::test4::id} = "id1"
{_test::%value of {_t2}%::id} > {_test::test4::id} = "id2"
{_test::%value of {_t3}%::id} > {_test::test4::id} = "id3"
And because you're setting the same var name three times, the last value that you've set will be the only one.
 
  • Like
Reactions: pepper82
Status
Not open for further replies.