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?
1 | script.Parent.Touched:connect( function (hit) |
2 | if hit and hit.Parent and hit.Parent:FindFirstChild( "Humanoid" ) then |
3 | hit.Parent.Humanoid.Health = 0 |
4 | end |
5 | end ) |
sir u were pretty close but if u want to check a variable ull have to put two "="s. or to rewrite urs:
1 | if script.Parent.CanCollide = = true then |
instead of
1 | if script.Parent.CanCollide = true then |