Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a NPC not attack another NPC?

I am trying to make a quick and easy, but fun game for me and some friends to play. All I want to do is make an NPC not attack another NPC but without any scripting. I don't want to put much effort into a game like this, so is there any way I could maybe make the NPCs be on the same team?

2 comments

0

I dont think there is a way to do this without scripting

0

You can change the name of the NPC's humanoids

1 answer

If you wouldn't mind a little scripting you could make a if statement that says not to attack the npc with that name. Here's an example that you can fit into the enemy's attack script:

if humanoid.Parent.Name == "NPC" then
	attack = false 
	--attack would be some kind of variable that says weather to go after something or not
end

This is just an example so if you copy paste this into a script it probably wont work in your specific script.

This discussion is preserved as it was. New answers, comments, and votes are closed.