#Custom Attack Speed

1 messages · Page 1 of 1 (latest)

cunning minnow
#

On damage, check the cooldown, and cancel

rigid wasp
#

I really did try, it had no errors, but did nothing. I am probably just terrible at skript, but here is an example.

on damage:
  attacker is player
  victim is mob
  set {_cooldown} to tag "tags;attackspeed" of nbt compound of attacker's tool
  set {_cd} to false
  if {_cd} is true:
    cancel event
  else:
    set {_cd} to true
    set damage to 1
    wait "%{_cooldown}% seconds" parsed as timespan
    set {_cd} to false

I want to learn this for now and for the future, maybe code looks dumb lol.

cunning minnow
#

Is a player/mob

rigid wasp
#

There is no errors, works the same.

unborn flint
#

Does it wait the correct amount of time? Is there any more code after that in the damage event? Have you tried to use “sending a message to yourself” to see where the code doesn’t work?

cunning minnow
rigid wasp
#

Yes, but it really doesn't matter. Even if i put it there, it won't change much. Thanks anyways, i will try to figure something out and stuff,

cunning minnow
#

It does matter

#
  loop all entities in radius 3 around event-block:

    # here you are comparing an entity to ‘a player’, checking if the looped entity is a player
    if loop-entity is a player:
      send “%loop-entity% is near you!” to player

    # here you compare an entity to ‘player’, and skript thinks you are checking if the looped entity is the (event-)player. 
    if loop-entity is player:
      send “you are here” to player```the “a” does matter
unborn flint
#

It indeed does