1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Skript' started by rwdish, May 8, 2022.

Thread Status:
Not open for further replies.
  1. rwdish

    rwdish New Member

    Joined:
    May 8, 2022
    Messages:
    8
    Likes Received:
    0
    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?
     
  2. Best Answer:
    Post #2 by Practice, May 8, 2022
  3. Practice

    Practice Member

    Joined:
    Apr 23, 2022
    Messages:
    37
    Likes Received:
    1
    A variable can store only 1 value. You should use list variables instead.
    Code (Text):
    1. on script load:
    2.     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"
    3.     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"
     
Thread Status:
Not open for further replies.

Share This Page

Loading...