Apply table on Lightning properties?

Assuming we got this table that has Lightning properties:

local LightningSettings = {
	Technology = Enum.Technology.ShadowMap,
	Brightness = 3,
	ColorShift_Top = Color3.new(255, 138, 35),
	GlobalShadows = true,
	ShadowSoftness = .05,
	ClockTime = 9,
	GeographicLatitude = 330,
	ExposureCompensation = .56,
	FogColor = Color3.new(255, 138, 35),
	FogEnd = 1000
}

Is there any way to apply those settings on Lightning? Despite applying it one by one, is there another way to do so?

1 Like

Iterate through it with a generic for loop and apply it by indexing the name and assigning it to the value:

local Lighting = game:GetService("Lighting");

for Property, Value in pairs(LightingSettings) do
    Lighting[Property] = Value;
end
3 Likes

I’ll try that right now, much appreciated!

1 Like