Solved Check status of attack cooldown?

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

Parrothead

Member
Feb 1, 2017
27
3
3
29
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
 
thats the cooldown for enderpearls and shields

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

example:
code_language.skript:
on join:
    while player is online:
        set {_cooldown} to player.getHandle().n(0)
        send actionbar "&2Attack recharge percent: &a%{_cooldown} * 100%%%" to player
        wait 1 tick
 
  • Like
Reactions: MultiverShaun
Status
Not open for further replies.