Help with Click Detector

This is honestly a super weird issue, I feel like it can only be an engine bug, because there is no explanation.

With Script Disabled:
image

With Script Enabled (as soon as I load in game, I can’t select it at all)

I was using tables, and decided to switch incase that made a difference, which it didn’t!

Script:

local lever = workspace.Lever
local dayLever = lever.DayLever
local nightLever = lever.NightLever
local clickDetector = lever.MainLever.ClickDetector

game.Players.PlayerAdded:Connect(function(player)
	local isNight = Instance.new("BoolValue",player)
	isNight.Name = "IsNight"
end)

clickDetector.MouseClick:Connect(function(player)
	if not player.IsNight.Value then
		game.ReplicatedStorage.Remotes.Events.UpdateTime:FireClient(player,"20:30:00","MAKE_NIGHT")
		player.IsNight.Value = true
	else
		game.ReplicatedStorage.Remotes.Events.UpdateTime:FireClient(player,"12:30:00","MAKE_DAY")
		player.IsNight.Value = false
	end
end)

Layout:
image

No errors, nothing in output.

I might switch to proximity prompts, but I still want to know if this is an issue with my end or roblox’s.

The code you provided doesn’t seem to fiddle with the ClickDetector aside from properly connecting to MouseClick. Perhaps you should double check that the CD is present at run-time (check the Workspace) and that you’re close enough (MaxActivationDistance) to trigger it.

Edit: Also ensure that you have a LocalScript which ahs connected to your UpdateTime event - I can’t remember if FireClient blocks the thread if nothing’s listening on the other end. If this is the problem you could in theory set IsNight.Value first, then call FireClient.

I am close enough, and the max distance doesn’t change. When I comment out the .MouseClick, I’m able to click it again.

Oh, that’s strange. I see you have two separate levers for night and day when the code implies the same lever is used for both. Perhaps that could be causing you issues.