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)

2 comments
put
if otherPart.Name == workspace.detector.Name thendoesn't work. still just nils