Looping 2 Lists at the Same Time

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

rustedst

Active Member
Apr 24, 2020
97
4
8
Istanbul, Turkey
I have 2 lists, one of them contains integers, the other contains item types. I want to do something like
Code:
give loop1-value of loop2-value to player

How can I do that?
[doublepost=1588152501,1588151466][/doublepost]I guess I solved the problem. For future reference:
Code:
set {_count} to 1
loop {list::*}:
    give player ({_count}th element out of {otherlist::*}) of loop-value
 
I have 2 lists, one of them contains integers, the other contains item types. I want to do something like
Code:
give loop1-value of loop2-value to player

How can I do that?
[doublepost=1588152501,1588151466][/doublepost]I guess I solved the problem. For future reference:
Code:
set {_count} to 1
loop {list::*}:
    give player ({_count}th element out of {otherlist::*}) of loop-value
code_language.skript:
loop {firstlist::*}:
    loop {secondlist::*}:
        #Fist list
        send "Yo this is the value of the first list: §a%loop-value-1%"
        send "Yo this is the index of the first list: §a%loop-index-1%"
        #Second List
        send "Yo this is the value of the second list: §b%loop-value-2%"
        send "Yo this is the index of the second list: §b%loop-index-2%"
 
Status
Not open for further replies.