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 How to check for permission true and false in the same line

Discussion in 'Skript' started by RoosSkywalker, Oct 1, 2022.

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

    RoosSkywalker Member

    Joined:
    Jul 16, 2022
    Messages:
    15
    Likes Received:
    0
    As the title suggest, I would like to check if one permission is true while the other is false. I know I could do
    Code (Text):
    1. if player has permission "test.me":
    2.     if player does not have permission "test.meagain":
    3.     do something
    But what I am trying to do is having it on the same line.
    Code (Text):
    1. if player has permission "test.me" and does not have permission "test.meagain":
    2.     do something
    How do I do this?
    You can check for permissions if both values are true or false, but I want to know how to do it like this if at all possible.

    The script I need this for:
    Code (Text):
    1. command /autojoin:
    2.     description: This command is used to automatically join the faction corresponding to your nation.
    3.     executable by: players
    4.     permission: skript.foreigner
    5.     permission message: &4You do not have access to that command.
    6.     trigger:
    7.         if player is in "Irikilum":
    8.             if player does not have permission "lands.wolfpact" and "lands.griffinempire":
    9.                 send "&4You cannot be factionless to use this command." to player
    10.             else if player has permission "lands.griffinempire" doesnt have permission "lands.wolfpact":
    11.                 make player execute command "/f join griffinempire"
    12.             else if player has permission "lands.wolfpact":
    13.                 make player execute command "/f join wolfpact"
    14.         else:
    15.             send "&4Test message. Failed the world check." to player
     
  2. Pierrelasse

    Pierrelasse Active Member

    Joined:
    Apr 20, 2022
    Messages:
    116
    Likes Received:
    4
    Maybe that?
    Code (Text):
    1.  
    2. if player has permission "someperm":
    3.   if player does not have permission "anotherperm":
    4.     send "ok"
    5.  
     
  3. RoosSkywalker

    RoosSkywalker Member

    Joined:
    Jul 16, 2022
    Messages:
    15
    Likes Received:
    0
    Thank you for reminding me to keep it simple.
    The solution:
    Code (Text):
    1. command /autojoin:
    2.     description: This command is used to automatically join the faction corresponding to your nation.
    3.     executable by: players
    4.     permission: skript.foreigner
    5.     permission message: &4You do not have access to that command.
    6.     trigger:
    7.         if player is in "Irikilum":
    8.             if player has permission "lands.wolfpact":
    9.                 if player does not have permission "lands.griffinempire":
    10.                     make player execute command "/f join wolfpact"
    11.             else if player has permission "lands.griffinempire":
    12.                 if player does not have permission "lands.wolfpact":
    13.                     make player execute command "/f join griffinempire"
    14.             else if player does not have permission "lands.wolfpact" and "lands.griffinempire":
    15.                 send "&4You cannot be nationless to use this command." to player
    16.         else:
    17.             send "&4You must be in Irikilum to use this command." to player
     
Thread Status:
Not open for further replies.

Share This Page

Loading...