add sublist to 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!

Gryphon2029

Active Member
Jun 30, 2021
75
3
8
62
I have been encountering errors in adding items to a list, then adding a sublist, then removing the whole list.
ps I had to make it {order:: orders::*} because of this {order::emoji_astonished:rders::*}

Basically this works but if there are two items in {order:: orders::*} and you remove the first one first it messes everything up.
code_language.skript:
add random string out of {@malenames} to {order:: orders::*}
set {_c} to size of {order::orders::*}
set {order::orders::%{_c}%::head} to random item out of {@maleheads}
set {_random} to round(random number between 1 and 7)
loop {_random} times:
    add random item out of {@items} to {order::orders::%{_c}%::items::*}
set {order::orders::%{_c}%::money} to size of {order::orders::%{_c}%::items::*} * round(random number between 3 and 7)

for addition information, this is the code I use to remove and item from {order:: orders::*}

code_language.skript:
clear {order::orders::%index of event-slot + 1%::*}
remove {order::orders::%index of event-slot + 1%} from {order::orders::*}