I have a script meant to change lighting and atmosphere properties. Though the lighting segment of the script works just fine, the atmosphere portion does not. I’m not sure if I’m doing the tweening wrong or if you simply cannot tween atmosphere. Either way, help would be greatly appreciated! I’ve looked through the devfourm but wasn’t really able to find anything relating to my issue. When I attempt to run the script the output says it cannot play nil.
for _, value in pairs(trigger:GetChildren()) do
local modifiedProperties = {}
local succ, err = pcall(function()
if value.Name ~= "TRANSITION" then
local tween
local goal = {[value.Name] = value.Value}
print(goal)
if value:GetAttribute("Type") == "Lighting" then
tween = t:Create(game.Lighting, tweenInfo, goal)
elseif value:GetAttribute("Type") == "Atmoshpere" then
tween = t:Create(game.Lighting.Atmosphere, tweenInfo, goal)
print(tween)
end
tween:Play()
table.insert(modifiedProperties, value.Name)
end
end)
if not succ then
warn(err)
end
end
end