First of all, name all of your NPC's humanoids to something other than 'Humanoid'.
Now, make a normal kill script but instead of checking if it is a player, check if the Humanoid in the player exists + is called whatever you called your NPCs' humanoids.
Example:
Let's say all your NPC's humanoids were called 'NPCBot'.
For the kill brick script if it was inside the brick, you would do the following:
local killbrick = script.Parent
killbrick.Touched:Connect(function(hit)
local hum = hit.Parent:FindFirstChild('NPCBot')
if hum then
hum.Health = 0
end
end)
Hope this helps!
2 comments
I am looking for any script/idea that can kill NPC's, because none of my scripts can harm any of them. The idea you have written will identify if the player is a NPC, or not, but will not kill it. However, thanks for this idea, it might be helpful later.
You need to make rest of the code..