had a script and GetPropertyChangedSignal isn’t working after certain time. It works and changes when clockTime goes 6 but when it goes 18 it doesn’t even change at all
-- ServerScript
LightningService:GetPropertyChangedSignal("ClockTime"):Connect(function()
if LightningService.ClockTime >= 6 then
for _, Out_Lights in CollectionService:GetTagged("OutsideLights") do
if Out_Lights.ClassName == "SpotLight" then
Out_Lights.Enabled = false
end
end
for _, Part_Lights in CollectionService:GetTagged("Lights_Parts") do
if Part_Lights.ClassName == "Beam" then
Part_Lights.Enabled = false
end
if Part_Lights.ClassName == "Part" then
Part_Lights.Color = Color3.new(0, 0, 0)
end
end
elseif LightningService.ClockTime >= 18 then
for _, Out_Lights in CollectionService:GetTagged("OutsideLights") do
if Out_Lights.ClassName == "SpotLight" then
Out_Lights.Enabled = true
end
end
for _, Part_Lights in CollectionService:GetTagged("Lights_Parts") do
if Part_Lights.ClassName == "Beam" then
Part_Lights.Enabled = false
end
if Part_Lights.ClassName == "Part" then
Part_Lights.Color = Color3.new(1, 1, 1)
end
end
end
end)
-- ServerScript
LightningService:GetPropertyChangedSignal("ClockTime"):Connect(function()
print("Changed!")
if LightningService.ClockTime >= 6 then
for _, Out_Lights in CollectionService:GetTagged("OutsideLights") do
if Out_Lights.ClassName == "SpotLight" then
Out_Lights.Enabled = false
end
end
for _, Part_Lights in CollectionService:GetTagged("Lights_Parts") do
if Part_Lights.ClassName == "Beam" then
Part_Lights.Enabled = false
end
if Part_Lights.ClassName == "Part" then
Part_Lights.Color = Color3.new(0, 0, 0)
end
end
elseif LightningService.ClockTime >= 18 then
for _, Out_Lights in CollectionService:GetTagged("OutsideLights") do
if Out_Lights.ClassName == "SpotLight" then
Out_Lights.Enabled = true
end
end
for _, Part_Lights in CollectionService:GetTagged("Lights_Parts") do
if Part_Lights.ClassName == "Beam" then
Part_Lights.Enabled = false
end
if Part_Lights.ClassName == "Part" then
Part_Lights.Color = Color3.new(1, 1, 1)
end
end
end
end)
it works, just like I told you. However, when the property tries to detect if the ClockTime is greater than 18 it doesn’t work and still keeps printing Time is Morning.
omg this worked FINALLY! I knew it has something to do with detecting if its lesser or greater bc I felt that the first line when detecting if clocktime is greater than 6 get’s overlapped a lot with clocktime greater than 18
No. YOu did first. I didn’t see it because I was doing it on Roblox Studio.
@iiNathxnism The reason why you need to check if it is less than 18 is bc you were checking if clock time was greater or equal to 6, and 18 is greater than 6, consequently resulting in true all-time.
I’m glad you’ve solved your problem! Any more helps, feel free to contact here!