When the brick containing this script, touches the brick that is named "Stop" it should change the bool value named Anchor to true, I even tried adding a print to check if it is working but the print statement was not printed so I can say that this script is not working.
What I mean: https://imgbomb.com/i/?IlZhv
After doing some tests, I came to the conclusion that this brick is detecting everything else that touches it except the brick named "Stop"...
Also, the brick containing the script is being cframed slowly through the brick named "Stop" and seems like that way it doesn't detect the brick named "Stop", how can I fix this problem?
function Stop(hit) print("it is working") if hit.Name == "Stop" then script.Parent.Parent.Settings.Anchor.Value = true end end script.Parent.Touched:connect(Stop)
Line 4 is your problem you did:
script.Parent.Parent.Settings.Anchor.Value = true
You should just do:
script.Parent.Parent.Settings.Anchor = true
Hope it helps!
script.Parent.Touched:connect(function(hit) if script.Parent:findFirstChild('Stop') then if hit.Parent.Name == 'Touch' then script.Parent.Parent.Settings.Anchor.Value = true end end end)
Try this it may work.