Solved How to make this more efficient?

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

GamingDay

Member
May 28, 2020
4
0
0
23
I have a script that blocks users from using certain commands (don't question my ways):
Code:
on command "/command1":
    if player doesn't have permission "{@permission}":
        message "{@nopermissions}"
        cancel event
    
on command "/command2":
    if player doesn't have permission "{@permission}":
        message "{@nopermissions}"
        cancel event
        
on command "/command3":
    if player doesn't have permission "{@permission}":
        message "{@nopermissions}"
        cancel event
        
on command "/command4":
    if player doesn't have permission "{@permission}":
        message "{@nopermissions}"
        cancel event
etc etc
Let it be known that I know nothing about Skript, is it possible to make this more efficient?
Something like:
Code:
on command "/command1" or "/command2" or "/command3" or "/command4":
    if player doesn't have permission "{@permission}":
        message "{@nopermissions}"
        cancel event
but that will actually work.
 
This should work right.
I don't know why but I can't get the on command "hello" or "hello2": to work..

Code:
on command:
  if command is "command1", "command2", "command3" or "command4":
    if player does not have permission "{@permission}":
      message "{@nopermissions}"
      cancel event
 
This should work right.
I don't know why but I can't get the on command "hello" or "hello2": to work..

Code:
on command:
  if command is "command1", "command2", "command3" or "command4":
    if player does not have permission "{@permission}":
      message "{@nopermissions}"
      cancel event
Let's say I have about a hundred of these:
Code:
on command "/command":
    if player doesn't have permission "{@permission}":
        message "{@nopermissions}"
        cancel event
Will this really make it faster/more efficient?
Code:
on command:
  if command is "command1", "command2", "command3" or "command4":
    if player does not have permission "{@permission}":
      message "{@nopermissions}"
      cancel event
 
Status
Not open for further replies.