Why is the script ignoring all my properties but printing?

  1. What do you want to achieve? I want to get my properties working in the script

  2. What is the issue? The properties i set in the script do not work

  3. What solutions have you tried so far? I tried editing the code Mutiple times

Hello, I’m having a problem getting my properties to work on the server script if anyone knows how to fix this I would love to know!
Script

local lighting = game.Lighting
local Brightness = game.Lighting.Brightness
local ShadowSoftness = game.Lighting.ShadowSoftness
local GlobalShadows = game.Lighting.GlobalShadows
local Ambident = game.Lighting.Ambient
local Outdoors = game.Lighting.OutdoorAmbient
local FogStart = game.Lighting.FogStart
local FogEnd = game.lighting.FogEnd
local fogcolor = game.Lighting.FogColor
while true do
	wait(1)
	if game.Lighting.ClockTime >=18 then
		print("It's night")
		GlobalShadows = false
		Outdoors = Color3.fromRGB(25,25,25)
		Ambident = Color3.fromRGB(0,0,0)
		Brightness = 0
		FogStart = true
		fogcolor = Color3.fromRGB(255,255,255)
	else
		if game.Lighting.ClockTime >= 8  then
			print("Day")
			GlobalShadows = true
			Outdoors = Color3.fromRGB(57,57,57)
			Ambident = Color3.fromRGB(138,138,138)
			Brightness = 2
			FogEnd = true
			fogcolor = Color3.fromRGB()
		end
	end
end

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

You are only changing the value of the variables but not the lighting properties. Also, the FogStart and FogEnd property must be set to a number, not a boolean.

local lighting = game.Lighting
while true do
	wait(1)
	if game.Lighting.ClockTime >=18 then
		print("It's night")
		lighting.GlobalShadows = false
		lighting.OutdoorAmbient = Color3.fromRGB(25,25,25)
		lighting.Ambient = Color3.fromRGB(0,0,0)
		lighting.Brightness = 0
		lighting.FogStart = 25
		lighting.FogColor = Color3.fromRGB(255,255,255)
	else
		if game.Lighting.ClockTime >= 8  then
			print("Day")
			lighting.GlobalShadows = true
			lighting.OutdoorAmbient = Color3.fromRGB(57,57,57)
			lighting.Ambient = Color3.fromRGB(138,138,138)
			lighting.Brightness = 2
			lighting.FogEnd = 25
			lighting.FogColor = Color3.fromRGB()
		end
	end
end
2 Likes

Thank you this has solved my problem

1 Like