#I want to run different script events depending on damage received

1 messages · Page 1 of 1 (latest)

crimson sphinx
#

Let me get into detail, I want to have a sword block system that depending on how much damage the attack blocked does plays a different animation e.g, 3 damage will be a light nudge while blocking, but 10 damage will knock the player back heavily

forest lark
#

You can use a Entity Hurt to detect the damage

#

but if you want to cancel the damage, Entity Hurt doesn't work, at least not yet

#

because Entity Hurt only is after event now, in previews the EntityHurtBeforeEvent is already exists

#

and with BeforeEvent can you know about the damage count and you can cancel the attack

#

after that you can use an apply knockback to make the animation of it pushing you back

crimson sphinx
orchid briar
#

if(Math.floor(data.damage)===1) player.triggerEvent("test")

just chain a pile of these together with if, and if else statement or a switch statement.

Or you can make a more advanced system if you need it.

crimson sphinx
crimson sphinx
#

In testing it, it doesn’t work

full meteor
#

You might have your statements ordered backwards, causing it to not fall through properly.

crimson sphinx
#

I had it as >= 9

#

Do u mean => 9

#

That just comes up as an error

#

Or could I use 9..

#

Or 4..8