Hello! So, I've been working on a place with a friend, and we're trying to make a ceiling light that turns off at night indicating that the store is closed, but turns on when it's day indicating that the store is open. There's no errors in the output, it just does nothing. Here's my current attempt at the script:
while wait(1) do
if game.Lighting.ClockTime == 0 then
script.Parent.PointLight.Enabled = false
script.Parent.BrickColor = BrickColor.new("Really black")
else
script.Parent.PointLight.Enabled = true
script.Parent.BrickColor = BrickColor.new("Institutional white")
end
end
Any answer that actually works is fine.
(It's a workspace script inside of the light part)

4 comments
When I change the lighting via explorer, the light stays on. Or is this something that only works in game and not studio play?
Nevermind, I figured out that it's something that ONLY works in game. Thanks for the help!
The reason that is happening is because when you press play in studio, everything in the explorer is local to you, meaning if you change it while playing, the rest of the server won't see it. You can either press "Run" instead and change the time and the light will work when you change the time or you can create a little script that changes the time automatically.
Glad I could help! If you want the time to change automatically, something simple could be creating a script and putting this in it: while wait(1) do game.Lighting.ClockTime += 1 end