Solved help by setting a permission to skript

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

MentalCode

Member
May 30, 2017
10
0
0
33
will they help me add an ami skript permission? is this:
code_language.skript:
on rightclick with a ender pearl:
    set {_waited} to difference between {cooldown::%player%::epearl} and now
    if {_waited} is less than 15 seconds:
        set name of player's tool to "&cYou must wait &e%difference between 15 seconds and {_waited}%&e &cto pearl again!"
        send "&cWait &b%difference between 15 seconds and {_waited}% &cto drop another!" to player
        cancel the event
    else:
        set {cooldown::%player%::epearl} to now
every 1 ticks:
    loop all players:
        if loop-player's tool is an ender pearl:
            set {_waited} to difference between {cooldown::%loop-player%::epearl} and now
            if {_waited} is less than 15 seconds:
                set name of loop-player's tool to "&cEnderPearl Cooldown &b%difference between 15 seconds and {_waited}%"
            else:
                set name of loop-player's tool to "&fEnder Pearl"
 
Do you want to add a permission to the event?
code_language.skript:
player has permission "put your permission node here":
Put the permission node that you want
 
Do you want to add a permission to the event?
code_language.skript:
player has permission "put your permission node here":
Put the permission node that you want
Could you give me an example with the complete skript please, im new with this from the skript
 
Last edited:
will they help me add an ami skript permission? is this:
code_language.skript:
on rightclick with a ender pearl:
    set {_waited} to difference between {cooldown::%player%::epearl} and now
    if {_waited} is less than 15 seconds:
        set name of player's tool to "&cYou must wait &e%difference between 15 seconds and {_waited}%&e &cto pearl again!"
        send "&cWait &b%difference between 15 seconds and {_waited}% &cto drop another!" to player
        cancel the event
    else:
        set {cooldown::%player%::epearl} to now
every 1 ticks:
    loop all players:
        if loop-player's tool is an ender pearl:
            set {_waited} to difference between {cooldown::%loop-player%::epearl} and now
            if {_waited} is less than 15 seconds:
                set name of loop-player's tool to "&cEnderPearl Cooldown &b%difference between 15 seconds and {_waited}%"
            else:
                set name of loop-player's tool to "&fEnder Pearl"
Don't use every 1 ticks. Use something like every second or every 10 ticks, at least that it won't trigger 20x a second
 
Okay so the permission is a condition, so think of if this way.... just like your "if player is holding" that is a condition, so just check for permission right before they're able to do something
like:
code_language.skript:
every 1 ticks:
    loop all players:
        if loop-player's tool is an ender pearl:
            if loop-player has permission "put.your.permission.node.here":
                set {_waited} to difference between {cooldown::%loop-player%::epearl} and now
                if {_waited} is less than 15 seconds:
                    set name of loop-player's tool to "&cEnderPearl Cooldown &b%difference between 15 seconds and {_waited}%"
                else:
                    set name of loop-player's tool to "&fEnder Pearl"
[doublepost=1532570049,1532569920][/doublepost]ALSO... I just wanted to say every 1 ticks (as stated above) is a bad idea. Why you asked.... because every tick means 20 times a second. Every tick you are looping all of your online players. That means lets say you have 20 players, 20x20=400 ... in 1 second, you would be looping 400 player's tools. That is a lot of work for the server. Now imagine you have 100 players on your server, EEK, that is too much.
I would suggest every second for something like that at the MOST
 
Status
Not open for further replies.