I'm trying to make a gear that changes a variable when it touches the detector brick. I set up a script to print the variable, but even after the gear touches the detector, it prints "nil". Can someone help?
function touched(otherPart) if otherPart.name == game.Workspace.detector then _G.gearInside = true end end script.Parent.Parent.Touched:connect(touched)
I needed to detect the handle, not the gear. Thank you to saSlol2436 and creeperhunter76 for helping me.