Solved Variables inside Variables

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

TheRazorGod

Member
Jun 9, 2018
17
0
0
24
I want to do something like this, but I'm getting the error in the photo.

code_language.skript:
options:
    cape1: &8Black &aCape
    cape2: &8White &aCape
    cape3: &8Brown &aCape
command /capes:
    trigger:
        send "&aAvaible Cape list;"
        loop 3 times:
            set {_number} to loop-number
            set {_capename} to "{@cape%{_number}%}"
            send "%{_capename}%"

NOTES:
Skript; Skript 2.2 bensku-dev25
Server; 1.8.8
ERROR:
 
Last edited:
You cant have variables inside of options
 
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.
 
Status
Not open for further replies.