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)
sir u were pretty close but if u want to check a variable ull have to put two "="s. or to rewrite urs:
if script.Parent.CanCollide == true then
instead of
if script.Parent.CanCollide = true then