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?
1 | function touched(otherPart) |
2 | if otherPart.name = = game.Workspace.detector then |
3 | _G.gearInside = true |
4 | end |
5 | end |
6 |
7 | script.Parent.Parent.Touched:connect(touched) |
I needed to detect the handle, not the gear. Thank you to saSlol2436 and creeperhunter76 for helping me.