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

Solved Message if has permission

Discussion in 'Skript' started by TechyGaming, Dec 30, 2019.

Thread Status:
Not open for further replies.
  1. TechyGaming

    TechyGaming Member

    Joined:
    Sep 22, 2019
    Messages:
    3
    Likes Received:
    0
    Hi,
    I am trying to create a script that send a message to players with the permission techcraft.worldchange.notify but after reading the Skript documentation and experimenting for hours I can't. Here's my current code:

    Code (Text):
    1. command /world <text>:
    2.   permission: techcraft.world
    3.   permission message: &cYou do not have permission to do this.
    4.   usage: /world <World Name>
    5.   trigger:
    6.     if arg 1 is set:
    7.       teleport the player to {world.%arg 1%}
    8.       message "&aAttempting to send you to %arg 1%..."
    9.       loop all players:
    10.         if loop-player has permission "techcraft.worldchange.notify":
    11.           wait 5 ticks
    12.           message "&7&o[&r&e%player%:&7&o connected to %world%...]"
    13.         else:
    14.           stop

    :: Below is just for variable context ::
    Code (Text):
    1. command /addworldspawn <text>:
    2.   permission: techcraft.worldspawn.create
    3.   permission message: &cYou do not have permission to do this.
    4.   trigger:
    5.     if arg 1 is set:
    6.       set {world.%arg 1%} to location of block at location of player
    7.       message "&aSucessfully created world spawn &2%arg 1%&a."
    8.     else:
    9.       message "&cInvalid Command Usage."
     
  2. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    I think you missed something

    Code (Skript):
    1.  
    2. command /world <text>:
    3.   permission: techcraft.world
    4.   permission message: &cYou do not have permission to do this.
    5.   usage: /world <World Name>
    6.   trigger:
    7.     if arg 1 is set:
    8.       teleport the player to {world.%arg 1%}
    9.       message "&aAttempting to send you to %arg 1%..."
    10.       loop all players:
    11.         if loop-player has permission "techcraft.worldchange.notify":
    12.           wait 5 ticks
    13.           message "&7&o[&r&e%player%:&7&o connected to %world%...]" to loop-player
    14.         else:
    15.           stop
    16.  
    17.  
    --- Double Post Merged, Dec 30, 2019, Original Post Date: Dec 30, 2019 ---
    The "to loop-player" at 13th line
     
  3. TechyGaming

    TechyGaming Member

    Joined:
    Sep 22, 2019
    Messages:
    3
    Likes Received:
    0
    You don't even know how much I hate myself for missing that.............

    Thank you so much!
     
  4. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    you're welcome
     
  5. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    344
    Likes Received:
    22
    Couger remove

    else:
    ....stop

    Cuz that will stop the trigger
     
  6. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    I just copied the code and corrected what he asked for.
     
    #6 couger44, Dec 31, 2019
    Last edited: Dec 31, 2019
Thread Status:
Not open for further replies.

Share This Page

Loading...