lighting.Changed not working correctly

This may be due to the roblox change on.Changed events, I don’t know how to use them still, but here’s my script.

local lighting = game:GetService("Lighting")
local etime = 20 -- when it goes on
local otime = 7 -- when it goes off
local function processChange()
	print("ch") -- this is temporary for a different function
end
lighting.Changed:Connect(function()
	processChange()
end)
2 Likes

If you changed a property inside Lighting through server(do not change it through client, or else it won’t trigger the event), it will print out “ch”.

APS is the one messing up live changes of Lighting, because you’re changing stuff through client and FilteringEnabled filters out the change.

1 Like

Instead of using .Changed, you should use the :GetPropertyChangedSignal() function.

The :GetPropertyChangedSignal() allows you to detect when a property of an instance (or if something was inherited from instance) changes. The first argument needed in :GetPropertyChangedSignal() is the property you are wanting to detect. Make sure changes are done on the server, if you want your script to work.

I was changing it thru the studio explorer, and I’m pretty sure that acts like a client, I’m going to make a new script and change the value – also I was thinking of avatar change improvements when I said .changed events, my bad also @iiJaguar_Cub, thanks for your reply as well. I’ll take that into consideration as well