function onTouched(hit)
if hit.Parent:findFirstChild("Humanoid") and hit.Parent:findFirstChild("Respawn") = nil then
hit.Parent.Humanoid:TakeDamage(.5)
end
end
script.Parent.Touched:connect(onTouched)
How would I make sure thats its a npc? Well, the player doesn't have a script named "Respawn" in it, but my npc does. so how would I use the :findFirstChild() function, but make sure that it respawns as nil, not a actually find it. Is there an other function?

3 comments
line 2 is an error.
if respawn = nil thenwhat's wrong with this firewolf? Not to mention,:findFirstChild()is deprecated, and:FindFirstChild()should be used instead. same goes for:connect(), it should be:Connect()Make sure to have double equal to sign.
i just copied and pasted his script, and then just edited it.