I need this script to run only if it's parent's CanCollide property is true. I already tried putting if script.Parent.CanCollide = true then but that broke the whole script. What thing do I add?
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
end
end)

2 comments
oh shoot, i'm really dumb
lol