{variable}th element 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 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 this skript that uses sth like "{variable}th element of {likst::*}" and I didn't have any error messages because of that. But, when I try to do "set ({variable}th element out of {list::*}) to {example}", it says "the random element of {list::*} can't be set to anything. Any solutions?
 
Instead of doing that, use this:
Code:
set {example} to {list::%{variable}%}
 
Thanks, but I need to get the Xth element of the list and change it. I actually simplified the code. That's what I want to do:
Code:
set {_count} to 1
loop {list1::*}:
    set {_variable1} to (loop-item - 1)
    reduce ({_count}th element of {list2::*}) by {_variable1}
    add 1 to {_count}
I simplified it again, but that's sort of what I want to do. But it says "the random element of {list2::*} can't be set to anything."
 
Status
Not open for further replies.