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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our 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.

Event "If player is OP" is not working

Discussion in 'Skript' started by Joni, Jan 12, 2019.

  1. J

    Joni Member

    Joined:
    Jan 5, 2019
    Messages:
    3
    Likes Received:
    0
    Hello, i'm trying to make a permission Skript and the "If player is OP" event is not working. It saids that there is no event "If player is OP".

    This is the code: https://pastebin.com/7c6KLQRA (line 149)

    Thank you if you help!
     
  2. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    775
    Likes Received:
    50
    Medals:
    you have to indent the line and the lines after that (from that trigger)
     
    • Agree Agree x 1
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    1,687
    Likes Received:
    119
    That is because 'if player is op' is not an event, its a condition
     
  4. J

    Joni Member

    Joined:
    Jan 5, 2019
    Messages:
    3
    Likes Received:
    0
    So how can you check if someone is op?

     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    1,687
    Likes Received:
    119
    you need to check if the player is an op in an event.
     
  6. J

    Joni Member

    Joined:
    Jan 5, 2019
    Messages:
    3
    Likes Received:
    0
    And how to do that? Please give me an example.
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    1,687
    Likes Received:
    119
    if player is op:
     
  8. Dave

    Dave Active Member

    Joined:
    Jul 20, 2018
    Messages:
    44
    Likes Received:
    0
    You just wrote your code wrong, put it on the first tab and take it as if it were an event and not a condition.
    Code (Skript):
    1.  
    2. on first join:
    3.     console command "/rank %player% default"
    4.     console command "/nte player %player% prefix &7"
    5.     if player is OP:
    6.         set {rank.%player%} to "Owner"
    7.         remove "permissions.default" from player's permissions
    8.         remove "permissions.helper" from player's permissions
    9.         remove "permissions.moderator" from player's permissions
    10.         remove "permissions.builder" from player's permissions
    11.         remove "permissions.admin" from player's permissions
    12.     if player has permission "Permissions.builder":
    13.         add "worldedit.*" to player's permissions
    14.         add "permissions.gamemode" to player's permissions
    15.         add "permissions.fly" to player's permissions
    16.     if player has permission "Permissions.helper":
    17.         add "permissions.fly" to player's permissions
    18.         add "permissions.kick" to player's permissions
    19.         add "permissions.warn" to player's permissions
    20.         add "permissions.mute" to player's permissions
    21.     if player has permission "permissions.moderator":
    22.         add "permissions.fly" to player's permissions
    23.         add "permissions.gamemode" to player's permissions
    24.         add "permissions.ban" to player's permissions
    25.         add "permissions.warn" to player's permissions
    26.         add "permissions.kick" to player's permissions
    27.         add "permissions.ban" to player's permissions
    28.     if player has permission "permissions.admin":
    29.         add "permissions.fly" to player's permissions
    30.         add "permissions.gamemode" to player's permissions
    31.         add "permissions.ban" to player's permissions
    32.         add "permissions.warn" to player's permissions
    33.         add "permissions.kick" to player's permissions
    34.         add "permissions.ban" to player's permissions
    35.         add "permissions.commands" to player's permissions
    36.         add "permissions.announce" to player's permissions
    37.     if player has permission "permissions.owner":
    38.         add "permissions.fly" to player's permissions
    39.         add "permissions.gamemode" to player's permissions
    40.         add "permissions.ban" to player's permissions
    41.         add "permissions.warn" to player's permissions
    42.         add "permissions.kick" to player's permissions
    43.         add "permissions.commands" to player's permissions
    44.         add "permissions.announce" to player's permissions
    45.         add "permissions.rank" to player's permissions
    46.         add "minecraft.command.op" to player's permissions
    47.         add "minecraft.command.deop" to player's permissions
     
Loading...