#How can i make a tag only remain for a second after player getting hurt

1 messages · Page 1 of 1 (latest)

frozen shard
#

How can i make this?:

When the player gets hurt, A tag will be added to player, and the tag will remove instantly, like each time player gets hurt, the tag will just get added for a second, and will be removed after the player's hurting time is over.

like simply just removeTag after 1 second, isn't it, idk

lost falcon
#

use system.runTimeout to take away the tag after 20 ticks.

frozen shard
#

system.runTimeout(() => {
    const p = world.getAllPlayers();
    p.forEach(player => {
        player.removeTag('back');
    });
},20);```
#

like that?

#

@lost falcon (srry for ping)

arctic harness
#

True

#

Put it inside the event

lost falcon
arctic harness
#

Yeah but it works for all the players

#

Just specify the player that taked the damage

#

And that s all

#

By putting it in the event itself

frozen shard
arctic harness
#

What event u use ?

lost falcon
#

right he wants it in the entityHitEntity or entityHurt

frozen shard
#

bruh i know how to use entityHurt

lost falcon
#

and he should get rid of the getting all players and just get the entity from the event

frozen shard
arctic harness
lost falcon
#

^

frozen shard
#

ah

#

i was a 'little' confused

#

alr lemme test it real quick

frozen shard
#

post is resolved

#

thanks for help