Attempt to connect failed: Passed value is not a function

I’m making a part that changes time when you click on it, it works but it says “Attempt to connect failed: Passed value is not a function”, and I have no idea how to fix it.


ClickDetector.MouseClick:Connect(function()
	game.Lighting.TimeOfDay = "20:30:00"
end)

script.Parent.Touched:connect(ClickDetector)

What are you wanting this line to do? It’s not click from what your post is.

If you meant for it to have the same function as the MouseClick does, then you should do this:

local function MouseClick()
	game.Lighting.TimeOfDay = "20:30:00"
end

ClickDetector.MouseClick:Connect(MouseClick)
script.Parent.Touched:Connect(MouseClick)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.