Solved Problem of list

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

Aralwen

Active Member
May 26, 2017
164
14
18
25
Hello, I have a problem with my lists. When I put 2 elements, it does not work anymore.
But if there is only one item in the list, it works

Code:
code_language.skript:
command /info:
    trigger:
        if {Liste::*} contains "Lemon":
            broadcast "ok"
           
command /add:
    trigger:
        add "Lemon" to {Liste::*}
        add "Orange" to {Liste::*}

Thank's :emoji_slight_smile:
 
Try:
code_language.skript:
command /info:
    trigger:
        loop {Liste::*}:
            if loop-value is "Lemon":
                broadcast "ok"
 
I also tried this way, it does not work :emoji_frowning:
code_language.skript:
command /info:
    trigger:
        loop {Liste::*}:
            "%loop-value%" is "Lemon"
            send "&aIt works!"

command /add:
    trigger:
        clear {Liste::*}
        add "Lemon" to {Liste::*}
        add "Orange" to {Liste::*}
That worked for me
 
code_language.skript:
command /info:
    trigger:
        loop {Liste::*}:
            "%loop-value%" is "Lemon"
            send "&aIt works!"

command /add:
    trigger:
        clear {Liste::*}
        add "Lemon" to {Liste::*}
        add "Orange" to {Liste::*}
That worked for me

Thank you very much, it works perfectly.
I just have a question, how to detect that the list is empty. Doesn't work :

code_language.skript:
if "%loop-value%" is empty:
if "%loop-value%" is null:
if "%loop-value%" is not set:
 
Thank you very much, it works perfectly.
I just have a question, how to detect that the list is empty. Doesn't work :

code_language.skript:
if "%loop-value%" is empty:
if "%loop-value%" is null:
if "%loop-value%" is not set:
code_language.skript:
if {Liste::*} is not set:
 
Status
Not open for further replies.