I put this script into another brick named "FF5". I want the FallingBrick to unanchor itself after I touch the FF5 brick. Can anyone help me?
print("FallingBrick Script Loaded") FallingBrick = script.Parent.Parent.FallingBrick function onTouched(hit) local human = hit.Parent.findFirstChild() if (human ~= nil) then FallingBrick.CanCollide = false FallingBrick.Anchored = true wait(0) FallingBrick.CanCollide = false FallingBrick.Anchored = true -- change this to true to make it Anchored after it falls end connection = FallingBrick.Touched:connect(onTouched) end
~Thank you for reading, Yeevivor4
print("FallingBrick Script Loaded") FallingBrick = script.Parent.Parent.FallingBrick function onTouched(hit) local human = hit.Parent.findFirstChild("Humanoid") --Your code is missing the argument to findFirstChild() if human then FallingBrick.CanCollide = false --Allow the brick to fall FallingBrick.Anchored = false --Allow the brick to fall end end connection = FallingBrick.Touched:connect(onTouched) end