closed

  • 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.
Uhhh, and where's the question? I see no problem in there...
It is meant as a tutorial (I think), although this is the wrong section.
Code:
command /list [<text>] [<text>]:
    trigger:
        if arg-1 is "add":
            if arg-2 is set:
                add arg-2 to {list::*}
                send "&7Successfully added &c%arg-2% &7to the list."
        if arg-1 is "remove":
            if arg-2 is set:
                if {list::*} contains arg-2:
                    remove arg-2 from {list::*}
        if arg-1 is "show":
            loop {list::*}:
                send "%loop-value%: %loop-index%"
        if arg-1 is "help":
            send "&7Help:%nl%&f/list add%nl%&f/list show%nl%&f/list remove"
        else:
            send "&c/list help"
You should use else if, since your code always sends "&c/list help" to the player, even though they used the command correctly. I think it's also a good idea to switch the index and value in /list show. The snippet also requires SkQuery, but only due to one expression used, which can easily be removed: new line. You should use multiple message effects (or multiple strings), to remove SkQuery as an dependency.
 
It is meant as a tutorial (I think), although this is the wrong section.

You should use else if, since your code always sends "&c/list help" to the player, even though they used the command correctly. I think it's also a good idea to switch the index and value in /list show. The snippet also requires SkQuery, but only due to one expression used, which can easily be removed: new line. You should use multiple message effects (or multiple strings), to remove SkQuery as an dependency.
OOF k
[doublepost=1569439854,1569411697][/doublepost]
It is meant as a tutorial (I think), although this is the wrong section.

You should use else if, since your code always sends "&c/list help" to the player, even though they used the command correctly. I think it's also a good idea to switch the index and value in /list show. The snippet also requires SkQuery, but only due to one expression used, which can easily be removed: new line. You should use multiple message effects (or multiple strings), to remove SkQuery as an dependency.
I always switch them ffs FUCK I KEEP FORGETTING
 
Status
Not open for further replies.