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 Pex groups

Discussion in 'Skript' started by JustADev, Aug 19, 2017.

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

    JustADev Well-Known Member

    Joined:
    Apr 8, 2017
    Messages:
    380
    Likes Received:
    9
    I'm wondering how to check if some argument is some group using PermissionsEX plugin.
    I tried : if arg 1 group is "Member": and also if group of arg 1 is "Member:
    With the first I'm getting Can't compare... error and with the second Can't understand this condition.
    So, where is my fault?

    Code:
    Code (Skript):
    1. on chat:
    2.     if player has permission "message.owner":
    3.         if {Class::%player%} is set:
    4.             cancel event
    5.             broadcast "&8[&7Lvl %{Level::%player%}%&8] &8[&7%{Class::%player%}%&8] [&6Owner&8] &7%player% &8» &f%message%"
    6.             stop
    7.         else:
    8.             cancel event
    9.             broadcast "&8[&7Lvl %{Level::%player%}%&8] [&6Owner&8] &7%player% &8» &f%message%"
    10.             stop
    what if I want to do it with a group like "Owner"?

     
    #1 JustADev, Aug 19, 2017
    Last edited: Aug 19, 2017
  2. Best Answer:
    Post #8 by ShaneBee, Aug 20, 2017
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    You can only check if a player has a permission. Doesn't work with groups.

    Add a custom permission, for example, 'admin', to a group. Then you can use player has permission "admin" to check if a player is in the group admin.
     
    • Funny Funny x 1
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    I did but it didnt work. I added message.owner to group Owner and it didnt work
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    What did not work?
    Errors on reload? Errors on console? Complete code?
    Use the help layout?
    ...please?
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    bro I legit typed:
    /pex group Owner add message.owner

    and then kept the same code
     
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
     
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    No errors madame.
    --- Double Post Merged, Aug 20, 2017, Original Post Date: Aug 20, 2017 ---
    except I want it so when a player is added into a certain group, it adds the perm to the group
     
  9. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Use the on command event for what you want to do. Split the arguments at " " and then execute the command to add the last arg as a perm. It'll be something like this
    Code (Skript):
    1.     set {_full_command} to full command
    2.     set {_command_args::*} to {_full_command} split at " "
    With pex your perm is the 5th argument so with that command you'd add %{_command_args::5}%
     
Thread Status:
Not open for further replies.

Share This Page

Loading...