When I use the script below, it only changes the MaxActivationDistance of one ClickDetector. I want it to do it to all the ClickDetectors it can find inside ModelA or at least on that level.
local a = game.Workspace.ModelA
local b = a:FindFirstChild("ClickDetector", true)
function onClicked()
script.Parent.ClickDetector.MaxActivationDistance = 0
wait(0.5)
script.Parent.Parent.Base.Beep:Play()
wait(1)
script.Parent.Parent.Base.Beep:Stop()
wait(0.5)
if b then
b.MaxActivationDistance = 0
end
wait(2)
script.Parent.Parent.Off.ClickDetector.MaxActivationDistance = 32
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
I understand I'm not explaining it very well but I can't really explain it any better.
Thanks!
