I'm making an NPC Tag game and I need the player to die when he/she touches the NPC. But when I spawn, the NPC is already dead. Anyone know how to fix this?
Here is the script. I put in every part of the NPC (Torso, arms, legs, head)
function onTouched(hit)
if not hit or not hit.Parent then return end
local human = hit.Parent:findFirstChild("Humanoid")
if human and human:IsA("Humanoid") then
human:TakeDamage(100)
end
end
script.Parent.Touched:connect(onTouched)

2 comments
Wait, you say the NPC is already dead. Does the NPC have the following: Humanoid, LeftArm, RightArm, LeftLeg, RightLeg, Torso, and a Head? and the humanoid health is 100 and maxhealth is 100 as well.
@rollercoaster57 Yep, it has all of those