Ontouched not working

Hi, i have a problem with my model, i want to damage an humanoid when he touch a part, but i got this error: Touched is not a valid member of Model

My script:

script.Parent.Touched:connect(function(part)
    if part.Parent:FindFirstChild("Humanoid") then
        part.Parent.Humanoid:TakeDamage(99)
    end
end)

Based on the error message you provided, it looks like you’re trying to connect a touch event from a model object. Models do not have a touched event, only base parts (Part, Spawn Point, Mesh Part etc).

Basically, put your script inside the part that a player has to touch.

Yeah I had the same problem I wanted a part to turn can collide of after a humanoid touches it for 1 second I just ended up deleting the script.

Apparently, the script is parented elsewhere that does not have the Touched event, which means it’s not directly parented to a BasePart. Try again by setting the script’s parent to the target BasePart, not anything else.

@Thorngard Try this
health 1.rbxm (2.6 KB)
But that will not kill if touched twice.