Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how do i make a npc follow the player and attack
- medians
-
Scratcher
1000+ posts
how do i make a npc follow the player and attack
You can make the npc point towards the player using this block:

And use the move steps block to move it towards the player at a certain speed:

This block will move based on the direction faced too, rather than just by x or y.

And use the move steps block to move it towards the player at a certain speed:

This block will move based on the direction faced too, rather than just by x or y.
- medians
-
Scratcher
1000+ posts
how do i make a npc follow the player and attack
what about attackIt depends what you mean by “attack”. You could just make a health variable for the player and lower it when the npc touches the player.
Last edited by medians (Feb. 6, 2023 00:05:37)
- zion95
-
Scratcher
5 posts
how do i make a npc follow the player and attack
no like how do i make the npc follow staying on the ground while shooting an attack and it will show next lvl
- medians
-
Scratcher
1000+ posts
how do i make a npc follow the player and attack
no like how do i make the npc follow staying on the ground while shooting an attack and it will show next lvlThen you can create a bullet sprite to shoot and create clones of (note that clones receive broadcasts). It depends where the ground is and if it is on a sprite or is colored or not.
Also, you can quote posts by clicking the quote button.
- zion95
-
Scratcher
5 posts
how do i make a npc follow the player and attack
oh tyno like how do i make the npc follow staying on the ground while shooting an attack and it will show next lvlThen you can create a bullet sprite to shoot and create clones of (note that clones receive broadcasts). It depends where the ground is and if it is on a sprite or is colored or not.
Also, you can quote posts by clicking the quote button.
- clelia773261
-
New Scratcher
1 post
how do i make a npc follow the player and attack
how do i make a npc attack a player without touching a button
- Discussion Forums
- » Help with Scripts
-
» how do i make a npc follow the player and attack