If player has permission?

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

Dovkin

Member
Oct 10, 2018
11
0
0
33
code_language.skript:
        player has permission "essentials.kits.%arg 1%":
            message "hello" to player
        else:
            message "bye" to player

I know this is part of what I need, but I'm using Luckperms, and I have a permission that comes and goes, that lasts 2 hours. I'm wanting it to check if the permission is active, then announce it to everyone, WITH the current time left on the permission? Is that possible?
 
is this permission, that is given to the player every 2 hours, given by Luckperms or Skript itself
 
is this permission, that is given to the player every 2 hours, given by Luckperms or Skript itself
I'm using Buycraft to run this command everytime I reach a community goal. "lp group default permission settemp mcmmo.perks.xp.200percentboost.all true 2h"
I currently have this to run what I'm wanting, but it also runs this even if the boost expires in just a few seconds after logging in.
code_language.skript:
on join:
    if player has permission "mcmmo.perks.xp.200percentboost.all":
        message "&dThere is currently a 200%% McMMO Experience boost!"
 
You could just create a custom command,
this command could execute a console command which would add the permission to the group as you currently have done with buycraft
then add a line where it adds a time span to a variable

have buycraft run this custom command rather than what it current is using

then use a periodical event to broadcast the time in that variable
 
  • Like
Reactions: Dovkin
You could just create a custom command,
this command could execute a console command which would add the permission to the group as you currently have done with buycraft
then add a line where it adds a time span to a variable

have buycraft run this custom command rather than what it current is using

then use a periodical event to broadcast the time in that variable
Could you give an example of the timer variable?
 
Cheers. Was hoping for something more along the lines of the actual command code to run, to start the timer.
Oh haha.
you could do something like
code_language.skript:
command /customBuycraft:
    executable by: console
    trigger:
        execute console command "your command to add the permission in your perm plugin"
        set {TimerVariable} to 2 hours
        send "Goal Reached - 2 Hours of McMMo XP boost starts now" to all players

now that variable is set to 2 hours, use a periodical event to subtract time from it
something like
code_language.skript:
every 10 minutes:
    remove 10 minutes from {TimerVariable}
    send "Time left on XP BOOST %{TimerVariable}%" to all players
something along those lines

edit:
You could obviously add some conditions and stuff to your periodical event, which would check if the time is greater than 0, and if not send a message that says its done or something like that
 
  • Like
Reactions: Dovkin
Status
Not open for further replies.