I made a script that is inside a model. There is also a folder called KillParts. The script is supposed to detect if you touch a kill part, but it isn't working. My script is:
local function DealDamage(part)
local hum = part.Parent:FindFirstChild("Humanoid")
if hum then
hum.Health = 0
end
end
for k,n in pairs(script.Parent.KillParts:GetChildren()) do
if n.Name == "KillPart" then
print("Touched")
n.Touched:Connect(DealDamage())
end
end
It also doesn't print "Touched"

3 comments
doesn't work.
have you put the parts in a model and the script in the same model? because thats what i did and it worked well.
I fixed it. Look at the answer above to see how.