Solved Not being able to register multiple objects for one variable.

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

rwdish

New Member
May 8, 2022
8
0
1
19
Hello! In my previous thread, i talked about my skript for registration numbers. Allthough it works, i wanted to try and put some letters in it, before the numbers. Here's what i tried to do:


on script load:
set {L} to "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V" and "Z"

on script load:
set {L2} to "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V" and "Z"


command /matricola:
trigger:
set {IDN} to a random integer between 1 and 99
set {IDL} to random object out of {L}
set {IDL2} to random object out of {L2}
make player execute command "/setlore &7Matricola: &aMT.%{IDL}%%{IDL2}%.%{IDN}%"

For the most part, it works, allthough the letters don't seem to: i get the error code: {L1} {L2} Can only be set to one object, not more. How can i fix this, and how do i get my variables to work?
 
A variable can store only 1 value. You should use list variables instead.
Code:
on script load:
    set {L::*} to "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V" and "Z"
    set {L2::*} to "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V" and "Z"
 
Status
Not open for further replies.