Hello, so I’m trying to change the settings of the time/lightning with just a click from inside the GUI. I’m mostly the type to search up the codes from the developer page but I’m still a bit new to getting around LUA. So here’s the script, I’d appreciate some help on how to accomplish this.
I’m also trying to make it go from noon setting to sunset setting then back again to noon settings do I need to use the “if then else” to do this? I saw this being done on a game called “Stay alive and flex your time on others.”
local lightingsunset = game.Lighting
local lightingsuncorrection = game.Lighting.ColorCorrection
local clocksuntime = game.Lighting.ClockTime
script.Parent.MouseButton1Click:Connect(function()
if then
game.Lighting.ClockTime = clocksuntime
game.Lighting.ColorCorrection = clocksuntime
game.Lighting.Ambient = lightingsunset
-- Lightning ambient Setting
lightingsunset.Ambient.R = 135
lightingsunset.Ambient.G = 122
lightingsunset.Ambient.B = 69
-- Lighting fog setting
lightingsunset.FogColor.R = 220
lightingsunset.FogColor.G = 216
lightingsunset.FogColor.B = 160
-- Lighting brightness
lightingsunset.Brightness = 60
-- Color correction setting
lightingsuncorrection.Contrast(-0.1)
lightingsuncorrection.TintColor(252, 241, 173)
lightingsuncorrection.Saturation(-0.1)
lightingsuncorrection.Brightness(0)
-- Clock time setting
clocksuntime = 10.2
-- Text setting
script.Parent.TextLabel.Text = "Noon"
else
game.Lighting.ClockTime = clocksuntime
game.Lighting.ColorCorrection = lightingsuncorrection
game.Lighting.Ambient = lightingsunset
-- Lighting ambient setting
lightingsunset.Ambient.R = 220
lightingsunset.Ambient.G = 121
lightingsunset.Ambient.B = 21
-- Lighting fog setting
lightingsunset.FogColor.R = 226
lightingsunset.FogColor.G = 175
lightingsunset.FogColor.B = 112
-- Lighting brightness
lightingsunset.Brightness = 60
-- Color correction setting
lightingsuncorrection.Contrast(-0.1)
lightingsuncorrection.TintColor(255, 131, 69)
lightingsuncorrection.Saturation(-0.1)
lightingsuncorrection.Brightness(0.1)
-- Clock time setting
clocksuntime = 17.6
-- Text setting
script.Parent.TextLabel.Text = "Sunset"
end
end)