In my game, i have spikes that kill you when you touch them with this script inserted inside:
function touch(hit)
if hit.Parent:findFirstChild("Humanoid")~=nil then
hit.Parent:findFirstChild("Humanoid").Health=0
end
end
script.Parent.touched:connect(touch)
But when i press play, studio freezes and this message appears: "A script has been running for a long time, and may be hanging." This didn't happen before, it only started now. Note: i know this script is making the error and when studio freezes, i have to force quit it.

2 comments
Wrong. FindFirstChild returns nil if specified object was not found, but I do agree about the ~= nil. It is redundant.
i took the script off someone and that the totality of the script