1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Check status of attack cooldown?

Discussion in 'Skript' started by Parrothead, Apr 26, 2018.

Thread Status:
Not open for further replies.
  1. Parrothead

    Parrothead Member

    Joined:
    Feb 1, 2017
    Messages:
    27
    Likes Received:
    3
    I've been searching the docs for a way to view attack cooldowns of players but I haven't had any luck. Attack cooldowns are the windup time after swinging to achieve maximum damage.

    The expression I see that might be what I'm looking for is below but because the example is wrong I can't tell. Does anybody know a way to check attack cooldowns and if the below syntax is correct can someone write a working example? Thanks so much!

    https://docs.skunity.com/syntax/search/Item Cooldown
     
  2. Best Answer:
    Post #2 by Donut, Apr 26, 2018
  3. Donut

    Donut Well-Known Member

    Joined:
    Mar 27, 2017
    Messages:
    1,336
    Likes Received:
    176
    Medals:
    thats the cooldown for enderpearls and shields

    to get the attack cooldown you can use skript mirror
    Code (Skript):
    1. player.getHandle().n(0)
    if youre not using 1.12 i believe it would be
    Code (Skript):
    1. player.getHandle().o(0)
    this returns a decimal between 0 and 1, 1 being fully recharged

    example:
    Code (Skript):
    1. on join:
    2.     while player is online:
    3.         set {_cooldown} to player.getHandle().n(0)
    4.         send actionbar "&2Attack recharge percent: &a%{_cooldown} * 100%%%" to player
    5.         wait 1 tick
     
  4. Parrothead

    Parrothead Member

    Joined:
    Feb 1, 2017
    Messages:
    27
    Likes Received:
    3
    Awesome, thanks for the help!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...