Script helping ClickDetector

Local script:

script.Parent.ClickDetector.MouseClick:Connect(function()

game.ReplicatedStorage.GasEvent:FireServer()

wait()

script.Parent.ClickDetector.MaxActivationDistance = 0

wait(300)

script.Parent.ClickDetector.MaxActivationDistance = 32

end)

not working.

Welp

LocalScripts can’t run in workspace, reference that script inside StarterPlayerScripts inside & reference the ClickDetector’s location again