What u need for my post:
- Tag Editor Post: Tag Editor Plugin - Bulletin Board - Developer Forum | Roblox
- Tag Editor Plugin: Tag Editor - Creator Store (roblox.com)
CollectionService: CollectionService | Documentation - Roblox Creator Hub
What u could try using is CollectionService, in cases that a normal for loop doesn’t work, collectionService will solve that issue, which in this case helped me greatly.
I will share my code so u will understand what to do.
local Lighting = game:GetService("Lighting")
local CollectionService = game:GetService("CollectionService")
for _, Lights in CollectionService:GetTagged("Lights") do
local PointLight = Lights:FindFirstChildWhichIsA("PointLight")
Lighting:GetPropertyChangedSignal("ClockTime"):Connect(function()
if Lighting:GetMinutesAfterMidnight() > 6*60 then
Lights.Material = Enum.Material.Plastic
PointLight.Enabled = false
end
if Lighting:GetMinutesAfterMidnight() > 18*60 then
Lights.Material = Enum.Material.Neon
Lights.Transparency = .2
PointLight.Enabled = true
end
end)
end
U can always consider adding TweenService for a smooth transition between enabled/disabling the street light posts.