Solved I need a help 3

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

Dani214

Member
Feb 9, 2020
16
1
3
19
Hello.

I have a problem again:

I want to delay the "/present" command, but I don’t know how to make the delay happen only if the player has a certain right, that is, 'permission.present', that is, if the player does not have was right, then the delay did not occur.

Code:
command /present:
    aliases: pr, donatepresent, dp
    trigger:
        if player does not have permission "permission.present":
            message "&cOnly a &6&ldonator&c can pick up a daily gift. Buy this status from the Administrato" to player
            play sound "block.anvil.destroy" with volume 1 at player
        if player has permission "permission.present":
            send "&aYou have received your donation gift. Come again after 24 hours." to player
            give 8 of golden ingot to the player
            give 5 of golden apple to the player
            give 3 of diamond to the player
            give 1 of emerald to the player
            give 10 of apple to the player
 
Hello.

I have a problem again:

I want to delay the "/present" command, but I don’t know how to make the delay happen only if the player has a certain right, that is, 'permission.present', that is, if the player does not have was right, then the delay did not occur.

Code:
command /present:
    aliases: pr, donatepresent, dp
    trigger:
        if player does not have permission "permission.present":
            message "&cOnly a &6&ldonator&c can pick up a daily gift. Buy this status from the Administrato" to player
            play sound "block.anvil.destroy" with volume 1 at player
        if player has permission "permission.present":
            send "&aYou have received your donation gift. Come again after 24 hours." to player
            give 8 of golden ingot to the player
            give 5 of golden apple to the player
            give 3 of diamond to the player
            give 1 of emerald to the player
            give 10 of apple to the player
Code:
    set {_cooldown} to difference between {cooldown.last::%player%} and now
    if {_cooldown} is less than 24 hours:
        stop
    set {cooldown.last::%player%} to now
 
  • Like
Reactions: Dani214
Code:
    set {_cooldown} to difference between {cooldown.last::%player%} and now
    if {_cooldown} is less than 24 hours:
        stop
    set {cooldown.last::%player%} to now
If it’s not difficult for you, you can enter it correctly in my script. I’m just not really catching up where I need to write, and the point is not that I don’t want, I just don’t know.
 
The first 3 lines go right after your permission check for the 24-hr perm. the 4th line can go at the end, but still indented under your if statement, as you want that variable set to when they last successfully used the command. You are comparing a variable containing the time it was successfully used with a variable containing the present time.
 
  • Like
Reactions: Dani214
The first 3 lines go right after your permission check for the 24-hr perm. the 4th line can go at the end, but still indented under your if statement, as you want that variable set to when they last successfully used the command. You are comparing a variable containing the time it was successfully used with a variable containing the present time.
I figured it out. Thanks for the help.
 
  • Like
Reactions: Wynnevir
Status
Not open for further replies.