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

LoneElf

Active Member
Apr 30, 2017
165
2
18
24
Hello! I couldn't see anything, but I wanted to check and ask before I pass by on it, but is there a tutorial somewhere explaining how to use list variables? I always see it and I don't really understand how to work with it. I kind of (barely) know what it is but I don't know how to use it so I'd like to learn.

I always see stuff with "::"s and "*" and all that and I just dunno how it all works.

Thanks. :emoji_slight_smile:
 
Okay thanks so much that helps a bunch.

How do I change the format of an expressed (messaged, broadcasted, etc.) list variable?

Code:
command /staff [<text>] [<text>]:
    trigger:
        if arg 1 is set:
            if arg 1 is "add":
                if arg 2 is set:
                    add arg 2 to {staff::*}
                else:
                    message "&7Use /staff add <player> to add a player"
            else:
                message "&7Use /staff add <player> to add a player"
        else:
            message "&7Servre staff: %{staff::*}%"

https://imgur.com/a/mTP3h0I

** on the image above, the first message is the actual skript code, and the second one is me using /say <text>. I'd like to know how to be able to change it so it would look like the second message. **

Thanks. :emoji_slight_smile:
 
you can try something like this (obviously use whichever color codes you wish)
code_language.skript:
set {_staff} to "&e%{staff:*}%"
replace all "and" with "&7and&e" in {_staff}
replace all "," with "&7,&e" in {_staff}
message "&7Servre staff: %{_staff}%"
 
That works, that's pretty cool. Thanks for all the help dude!

Take it easy! :emoji_slight_smile:
 
Status
Not open for further replies.