Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I create a follow script for an Enemy NPC that chases the users around?

Asked by 6 years ago

I am pretty new with Lua, so be nice...

I have put in my research/time in trying to figure this out, but can't seem to figure out the full answer. What I want is for an enemy to follow the user around within a closeish-range. The first problem that I ran into was that my friend was a R15 model and I had to change Torso to HumanRootPart - Solved. The second and largest problem was that I was using the typical find nearest torso on Humanoids, but soon realized that the enemy would start chasing after the NPC's in the background. Please help me with code snippets! Thank you for the help in advance.

1 answer

Log in to vote
0
Answered by 6 years ago

Just change the UpperTorso name or the Non-Enemy NPC Torso to "N_PC" and the Enemies to "E_NEMY", you can change the names to whatever you want, but keep the script for UpperTorso or the Torso, will be corrected.

"Why Latine?" : It happened because the Enemy is attacking everything that has a Torso or HumanRootPart with those names, I change it, the script will detect it as "false" bool and will not do anything, but will cause the Enemy to attack and follow the Upper Torso or Player's Torso.

0
@Latine_Lemonade What part of this script do i change to HumanRootPart, and what part do I change to N_PC and E_NEMY - please help YouEnglish -5 — 6y
Ad

Answer this question