Small lines of code problem

  1. For the click detector to be enabled only when the gui is visible.

  2. No errors on output, just doesn’t work so I’m guessing it’s my scripting skills.

  3. I tried both script and local-script, and couldn’t find any help regarding this exact issue.

local lowergui = script.Parent

if lowergui.Visible == true and workspace.normalPlot.ClickDetector.MaxActivationDistance < 1 then
	workspace.normalPlot.ClickDetector.MaxActivationDistance = 15
else
	return
end

There’s no errors, so that means something in your if statement is false.
Double check if your gui is visible and your MaxActivationDistance is < 1 in the explorer.

Whenever in doubt, debug:

local lowergui = script.Parent
local Check1 = lowergui.Visible == true 
local Check2 = workspace.normalPlot.ClickDetector.MaxActivationDistance < 1

print(Check1)
print(Check2)

if Check1 and Check2 then
	workspace.normalPlot.ClickDetector.MaxActivationDistance = 15
else
	warn("One of the checks didn't return back true")
end

Thank you so much! I was able to modify your script to meet what I wanted. It works perfectly!