1. 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!


    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Block/Unblock Command on Server Skript

Discussion in 'Skript' started by Ali Tuna BAYLAN, Jun 5, 2022.

Thread Status:
Not open for further replies.
  1. Ali Tuna BAYLAN

    Jun 5, 2022
    Likes Received:
    Usage: /blockcmd [command], /unblockcmd [command]
    Example: /blockcmd help
    Code (Text):
    1. on command:
    2.     if {blockcmd::*} contains command:
    3.         cancel event
    4.         send "This command is blocked."
    5. command /blockcmd <text>:
    6.     permission: op
    7.     trigger:
    8.         if arg-1 is set:
    9.             if {blockcmd::*} contains arg-1:
    10.                 send "This command is already blocked!"
    11.             else:
    12.                 add arg-1 to {blockcmd::*}
    13.                 send "Succesfully blocked command: /%arg-1%"
    14.         else:
    15.             send "Please enter a command."
    16. command /unblockcmd <text>:
    17.     permission: op
    18.     trigger:
    19.         if arg-1 is set:
    20.             if {blockcmd::*} contains arg-1:
    21.                 remove arg-1 from {blockcmd::*}
    22.                 send "Succesfully unblocked command: /%arg-1%"
    23.             send "Command is not blocked."
    24.         else:
    25.             send "Please enter a command."
Thread Status:
Not open for further replies.

Share This Page