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!

Jan 29, 2017
2
0
0
34
Hello,
I wanted a very simple Skript (script)

Basically, there will be a list of commands that are allowed to be executed. When a player executes a command other than the one in the list, it will throw a message and cancel event (like Unknown command)

This is to prevent people from getting the plugins.
This is how I wanted it to be like:

a list of allowed commands,
on command: check if the command is in the list

if true, continue with execution of the command.
else send a message "Unknown command" and cancel event

I tried to make it myself but I got lost very easily Dx. Can someone help me with this?
Thanks!
 
code_language.skript:
on command:
    if executor is player:
        if command isn't "op" or "help": #<---- Put whatever commands you want
            cancel event
            message "&rUnknown Command."
            stop
 
code_language.skript:
on command:
    if executor is player:
        if command isn't "op" or "help": #<---- Put whatever commands you want
            cancel event
            message "&rUnknown Command."
            stop

That's perfect :emoji_grinning:
But is there arrays/slices which we can loop through in skript? That'd make it so much nicer :emoji_stuck_out_tongue:.