Help with skript (if player has permission, do xyz...)

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

Aidan

Member
Aug 7, 2020
12
0
1
28
Hi!

My skript I'm trying to create is to give out a golden shovel. If the player has the permission "GP.shovel", they can type the command "/shovel" (which every rank has.)

If the player has the permission "GP.shovel.use", they can receive one golden shovel per five minutes. It will then send the player how much remaining time there is until the command can be used again.

If the player has the permission "GP.shovel.admin", they can receive one golden shovel every time they type /shovel - No five minute delay.

The problem is when I type /shovel with the permission GP.shovel.admin, it still sends me a message about how much time remaining I have, and gives me the shovel.
As the default rank, which only has the permission GP.shovel.use, it will does the exact same thing as the people with the permission GP.shovel.admin. I was wondering if someone could help me
I don't know if this makes any difference, but I use LuckPerms as my permissions plugin.

Here is the code:
Code:
command /shovel:
    description: Gives you a shovel. Once per 5 minutes
    permission: GP.shovel
    executable by: players
    trigger:
        if player has the permission "GP.shovel.admin":
            message "&6Recieving shovel!"
            make console execute "give %player% golden_shovel 1"
        if player has the permission "GP.shovel.use":
            set {_waited} to difference between {shovel.%player%.lastused} and now
            if {_waited} is less than 5 minutes:
                message "&6You have recently executed this command. Wait &c%difference between 5 minutes and {_waited}% &6until you can execute this command."
                stop
       
            player doesn't have space for a cake:
                message "You do not have enough space in your inventory to hold the shovel!"
                stop
           
            make console execute "give %player% golden_shovel 1"

            set {shovel.%player%.lastused} to now

Thank you!
 
add "stop" after the admin one since the player has both permissions it will do both of these if's or make the other one elseif
 
add "stop" after the admin one since the player has both permissions it will do both of these if's or make the other one elseif
I tried that before, and it still told the person with the permission GP.shovel.admin how much time was remaining.
I even gave the staff no permissions for the rank GP.shovel.use
 
Status
Not open for further replies.