Solved Command Blocker

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

Tropical

Member
Jan 29, 2017
19
0
1
29
Category: dont know

Suggested name: cmdblocker

What I want: I know how to make an actual command blocker, but my request is trickier. I need a Skript that allows the command "/login", but blocks anything else, by canceling the event. I've tried multiple methods, and none have worked.

Ideas for commands:
None

Ideas for permissions:
None

When I'd like it by: A reasonable time
 
Hey, this should do the trick. If not don't hesitate to reply.

code_language.skript:
on command:
    loop {login.commandwhitelist::*}:
        if command is loop-value:
            stop
        else:
            cancel event
                send "&cYou can not do this. Use /login first."
                stop loop

command /loginwhitelist [<text>]:
    trigger:
        if arg 1 is set:
            add argument-2 to {login.commandwhitelist::*}: