Skript List Variables -> strange "size of" - result

  • 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
Hi all,
I have this example script:

Code:
command /listtest:
   trigger:
       add "test" to {_testlist::*}
       add "name1" to {_testlist::test::members::*}
       add "name2" to {_testlist::test::members::*}
       broadcast "%size of {_testlist::*}%"
       broadcast "%{_testlist::*}%"
       message "-----"
       loop {_testlist::*}:
           message loop-value

Result/Output:
https://i.imgur.com/ZOeRbKp.png

WHY is the list size 2 ? Does that make any sense? Because when you look at the loop result, there is only 1 entry (correct). And in the broadcast of the testlist, there seem to be 2 results ("test" and <none>)?

Can anybody tell me if that is a bug or if that is correct and why?
 
Since you're using message loop-value instead of message "%loop-value%", the first one doesn't message anything when it isn't set, the last one does
 
Okay I just did some more testing and I think it's a bug, you should report it on the bug tracker.
With the code
Code:
command /listtest:
    trigger:
        add "test" to {_testlist::*}
        add "name1" to {_testlist::test::members::*}
        add "name2" to {_testlist::test::members::*}
        broadcast "%size of {_testlist::*}%"
        broadcast "%{_testlist::*}%"
        message "-----"
        loop {_testlist::*}:
            message "%loop-index%: %loop-value%"
you get
Code:
2
test and <none>
----
1: test
which is a bug, because it says that there are 2 elements in the list (size of list returns 2), but the loop displays only one element. It should return 1 for the size, and not include the <none> in the message list effect.
 
Status
Not open for further replies.