Solved How to check for permission true and false in the same line

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

RoosSkywalker

Member
Jul 16, 2022
14
0
1
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:
if player has permission "test.me":
    if player does not have permission "test.meagain":
    do something
But what I am trying to do is having it on the same line.
Code:
if player has permission "test.me" and does not have permission "test.meagain":
    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:
command /autojoin:
    description: This command is used to automatically join the faction corresponding to your nation.
    executable by: players
    permission: skript.foreigner
    permission message: &4You do not have access to that command.
    trigger:
        if player is in "Irikilum":
            if player does not have permission "lands.wolfpact" and "lands.griffinempire":
                send "&4You cannot be factionless to use this command." to player
            else if player has permission "lands.griffinempire" doesnt have permission "lands.wolfpact":
                make player execute command "/f join griffinempire"
            else if player has permission "lands.wolfpact":
                make player execute command "/f join wolfpact"
        else:
            send "&4Test message. Failed the world check." to player
 
Maybe that?
Code:
if player has permission "someperm":
  if player does not have permission "anotherperm":
    send "ok"
 
Thank you for reminding me to keep it simple.
The solution:
Code:
command /autojoin:
    description: This command is used to automatically join the faction corresponding to your nation.
    executable by: players
    permission: skript.foreigner
    permission message: &4You do not have access to that command.
    trigger:
        if player is in "Irikilum":
            if player has permission "lands.wolfpact":
                if player does not have permission "lands.griffinempire":
                    make player execute command "/f join wolfpact"
            else if player has permission "lands.griffinempire":
                if player does not have permission "lands.wolfpact":
                    make player execute command "/f join griffinempire"
            else if player does not have permission "lands.wolfpact" and "lands.griffinempire":
                send "&4You cannot be nationless to use this command." to player
        else:
            send "&4You must be in Irikilum to use this command." to player
 
Status
Not open for further replies.