Solved using the same command with different permissions

  • 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 community!

    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.

Reecepbcups

Member
Apr 18, 2018
2
0
0
alright, so I need to have a skript that removes a players staff rank, and replaces it with the staffAFK rank. So I have /staffafk, and /staffunafk. Only problem is I can only use 1 permission per command to give back and take away (because there are many staff ranks). Is there anything you can think of that would allow me to do this?
Pluigns being used in this are Skript, PermissionEx, nte tags.
Current code:

code_language.skript:
## Reecepbcups

options:
    NoPermission: &cYou don't have permission to use this command.
 
command /staffafk:
    permission: staffafk.helper.use
    permission message: {@NoPermission}
    aliases: afkstaff
    trigger:
        execute console command "/pex user %player% group remove Helper"
        execute console command "/pex user %player% group add StaffAFK"
        execute console command "/nte reload"
    
command /unStaffAFK:
    permission: unafk.helper.use
    permission message: {@NoPermission}
    aliases: staffunafk
    trigger:
        execute console command "/pex user %player% group remove StaffAFK"
        execute console command "/pex user %player% group add helper"
        execute console command "/nte reload"

so because there are other ranks, like mods and more, how can I set it up for them too with the same command, but a different output from that other command with the different permission
 
I feel like there would be a better way to set up prefixes/nametags but if this is the way you would want to do it,
I would change your command permission to something like "staffafk.use" and then add If permission statements like this
code_language.skript:
trigger:
    if player has permission "staff.helper"
        execute console command "/pex user %player% group remove Helper"
        execute console command "/pex user %player% group add StaffAFK"
        message "AFK rank added" to person
        execute console command "/nte reload"
    if player has permission "staff.admin"
        execute console command "/pex user %player% group remove admin"
        execute console command "/pex user %player% group add StaffAFK"
        message "AFK rank added" to person
        execute console command "/nte reload"
And just repeat that for each level of staff
[doublepost=1524087792,1524087694][/doublepost]OH JK I thought of a better way.... OK set up "weights" for all your ranks.
And make a rank called "staffafk" as your highest weight.
So you can ADD (rather than set) this rank to a staff member... and because it has the highest rank, it'll use THAT prefix
[doublepost=1524088007][/doublepost]Here is some info on Pex's WEIGHT SYSTEM
 
Status
Not open for further replies.