Dictionary error when tweening lighting to a table value and other value of it

hello i am trying to make it so during foggy rounds the tween stops current tween and changes it to a another one to make it foggy, when i try to do it THIS returns


i searched solutions but none of them matched.
heres the line that tweens

elseif SV == "Foggy" then
		KillerTextValue.Value = tostring(KILLER)
		spawner()
		LightingTween:Cancel()
		task.wait(0.01)
		local LightingTween2 =  game.TweenService:Create(game:GetService("Lighting"),TweenInfo.new(5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0),{Lightings.Night,FogEnd = 200})
		LightingTween2:Play()
1 Like

i am still trying to figure it out, i keep moving the fog end and the lightnings.night to everywhere but none of them work

2 Likes

em
this is the table

The table of properties passed to the Tween need to be valid properties of the instance being tweened. Moreover they also need to have tweenable values, and have target values set.
Currently you are trying to Tween the lightings.night property of the lighting service with no value, and the fogend property. But these should be the target values of a valid property.

1 Like

could you explain this in coding please?

Looking at your code, I think you want to do this:

local LightingTween2 =  game.TweenService:Create(game:GetService("Lighting"),TweenInfo.new(5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0),Lightings.Night)

This would use the table Lightings.Night as the properties table, and would tween to those values.
To set fogEnd to a different value separately, you would be better off cloning the table, and changing the fogEnd to your desired value, then using that in the tween instead. (Assuming you want all the values in the table to tween)
Something like this:

local tClone = table.clone(Lightings.Night)
tClone.FogEnd = 200
local LightingTween2 =  game.TweenService:Create(game:GetService("Lighting"),TweenInfo.new(5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0), tClone)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.