Skript that decreases the time need between attacks

  • 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 community!

    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!

20Spaces

Member
Apr 26, 2024
33
3
8
Im creating a Skript where every time x happens than the player gets a reduced attack cooldown. I thought I could use the attack cooldown function for this, however that only represents whether an attack is full charged. I believe the correct thing to do is to change the attack cooldown attribute , however I am unaware of how to do this. Could I have an example?
 
Update:

Code:
on death:
    set {speed::victum's uuid} to {speed::victum's uuid} + 0.5
    set {speed::attacker's uuid} to {speed::attacker's uuid} - 0.5
    loop all items in the inventory of attacker:
        if loop-item is any sword or any axe or trident:
        add "{AttributeModifiers:[{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:%{speed::player's uuid}%,Operation:0,UUIDLeast:8055,UUIDMost:772149}]}" to nbt of loop-item

on first join:
    set {speed::player's uuid} to 0

on inventory slot change:
    if event-item is any sword or any axe or trident:
        add "{AttributeModifiers:[{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:%{speed::player's uuid}%,Operation:0,UUIDLeast:8055,UUIDMost:772149}]}" to nbt of event-item

I think this might work? However this Skript just sets the speed of an item, I want it to add or subtract from the usually speed of ___ item. Any thoughts on how to do this?