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 Variables inside Variables

Discussion in 'Skript' started by TheRazorGod, Jun 9, 2018.

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

    TheRazorGod Member

    Joined:
    Jun 9, 2018
    Messages:
    17
    Likes Received:
    0
    I want to do something like this, but I'm getting the error in the photo.

    Code (Skript):
    1.  
    2. options:
    3.     cape1: &8Black &aCape
    4.     cape2: &8White &aCape
    5.     cape3: &8Brown &aCape
    6. command /capes:
    7.     trigger:
    8.         send "&aAvaible Cape list;"
    9.         loop 3 times:
    10.             set {_number} to loop-number
    11.             set {_capename} to "{@cape%{_number}%}"
    12.             send "%{_capename}%"
    13.  
    NOTES:
    Skript; Skript 2.2 bensku-dev25
    Server; 1.8.8
    ERROR:


     
    #1 TheRazorGod, Jun 9, 2018
    Last edited: Jun 9, 2018
  2. Best Answer:
    Post #4 by DieHollander_, Jun 10, 2018
  3. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    You cant have variables inside of options
     
  4. TheRazorGod

    TheRazorGod Member

    Joined:
    Jun 9, 2018
    Messages:
    17
    Likes Received:
    0
    How can make this in another way?
     
  5. DieHollander_

    DieHollander_ Active Member

    Joined:
    Mar 25, 2018
    Messages:
    188
    Likes Received:
    12
    Just use variables instead of options
     
  6. TheRazorGod

    TheRazorGod Member

    Joined:
    Jun 9, 2018
    Messages:
    17
    Likes Received:
    0
    We will do that. Thanks for helps.
     
  7. Mr_Simba

    Mr_Simba King of the Pridelands
    Moderator Supporter

    Joined:
    Dec 9, 2016
    Messages:
    257
    Likes Received:
    55
    Medals:
    Just to make it clear why this is the case (so you better know when & where to use options in the future), options are parsed before ANYTHING else in the script. They just give very simple text replacement functionality, with the text in the option being dropped in wherever you use it before the script is parsed at all. That means you can't use variables in them because the values of those variables aren't even known yet when the options are parsed yet. That's why option values are mostly used as a config or for constants.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...