Hello,
I am making a script so that when the player's torso y position is > 1500, the sky turns to night time. I'm pretty sure the problem is that i'm trying to make it happen to only one player. When I run the game, the sky turns very bright neon white which is not what happens when I manually change the lighting.
Here is my code, written in a LocalScript located in StarterCharacterScripts:
local character = script.Parent
local Atmosphere = game.Lighting.Atmosphere
local Lighting = game.Lighting
while true do
local pos = character.UpperTorso.Position.Y
if pos > 1500 then
Atmosphere.Color = Color3.new(40,40,40)
Lighting.TimeOfDay = "24:00:00"
else
Atmosphere.Color = Color3.new(250,250,250)
Lighting.TimeOfDay = "15:00:00"
end
wait(2)
end
Thank you again!

6 comments
Note; the part that checks the player's Y position is not the problem.
what's the output
nvm
Use local scripts
There is no output, it just turns the sky neon.
I am already using a LocalScript located in StarterCharacterScripts