Ncp's head does not want to lisen scripts

Hello this is my first post in this forum! :grinning:

oh and also im terrible at English grammar, spelling and etc… :sweat_smile:

So im trying to achieve that when player touches npc’s head, the player dies but that does not happen…

That script worked only 1-2 times and then stops working and i think its problem about npc’s head because in my other game that worked perfectly fine so i don’t know what to do :man_shrugging:
this is my script:

local function onTouch(Touch)
	if Touch.Parent:FindFirstChild("Humanoid") ~= nil then
		Touch.Parent.Humanoid:TakeDamage(100) 
		
	end
end

script.Parent.HumanoidRootPart.Touched:Connect(onTouch)
script.Parent.Head.Touched:Connect(onTouch)

(when players touches HumanoidRootPart it does kill player)
so i dont know really do i put this in #help-and-feedback:building-support or #help-and-feedback:scripting-support

now i tried watching some tutorials and it had same problem…

oh btw, im terrible at scripting lol

and thats it. please help if you can.

Try Touch.Parent.Humanoid.Health = 0 instead.

hey @Friendly4Crafter it worked! Player does die when he touches head! but there is a one problem…
so i puted “humanoid:TakeDamage(100)” for a reson.
If player had forcefeild and script wouldn’t had “humanoid:TakeDamage(100)” the player would die so i want when player has forcefield that he is invincible…
so is it possible to use “humanoid:TakeDamage(100)” in diffrent way?
for now im gona use “humanoid.Health = 0”
Again thanks for help :smiley: