hello!
im a new developer and i noticed my map looks very bad with the green tint at night but during the morning looks very good
the sime applies but with the color white and opposite order!
i made this simple script and im not getting any errors. i believe i just ordered something incorrectly.
script:
local Time = 0.01
local TimeChange = 0.01
while wait(Time) do
game.Lighting.ClockTime = game.Lighting.ClockTime + TimeChange
end
while true do
if game.Lighting.TimeOfDay <= "0:5:00:00" then
game.Lighting.OutdoorAmbient = ("85, 185, 11")
else
game.Lighting.OutdoorAmbient = ("185, 185, 185")
end
end
local Time = 0.01
local TimeChange = 0.01
spawn(function()
while wait(Time) do
game.Lighting.ClockTime = game.Lighting.ClockTime + TimeChange
end
end)
while true do
wait()
if game.Lighting.TimeOfDay <= "0:5:00:00" then
game.Lighting.OutdoorAmbient = Color3.new(85, 185, 11)
else
game.Lighting.OutdoorAmbient =Color3.new(185, 185, 185)
end
end
local Time = 0.01
local TimeChange = 0.01
spawn(function()
while wait(Time) do
game.Lighting.ClockTime = game.Lighting.ClockTime + TimeChange
end
end)
while true do
wait()
if game.Lighting.ClockTime <= 4.5 and game.Lighting.ClockTime >= 18 then
game.Lighting.OutdoorAmbient = Color3.new(0, 1, 0.498039)
elseif game.Lighting.ClockTime >= 4.5 and game.Lighting.ClockTime <= 18 then
game.Lighting.OutdoorAmbient = Color3.new(1, 1, 1)
else
print("error")
end
end
and it printed “error” meaning the issue is unresolved and the script is still broken!
Sorry i cant solve the outdoorambient it was you who should fix it cuz i gave solution for the topic and i cant give solutions which are not the topic
(Btw u kept the print(error) msg lol)
Just letting you know, spawn() and wait() are becoming deprecated very soon, and have big memory leaks. I just changed it to the newer task.spawn() and task.wait() below. I also added a Property Changed event in so that it will not need to constantly repeat its code. You will understand this code when you become better, and why I did this.
local Time = 0.01
local TimeChange = 0.01
game.Lighting:GetPropertyChangedSignal("ClockTime"):Connect(function()
if game.Lighting.ClockTime <= 4.5 and game.Lighting.ClockTime >= 18 then
game.Lighting.OutdoorAmbient = Color3.new(0, 1, 0.498039)
elseif game.Lighting.ClockTime >= 4.5 and game.Lighting.ClockTime <= 18 then
game.Lighting.OutdoorAmbient = Color3.new(1, 1, 1)
else
print("error")
end
end)
task.spawn(function()
while task.wait(Time) do
game.Lighting.ClockTime = game.Lighting.ClockTime + TimeChange
end
end)