Hello! Does anyone know about the error [ColorCorrection is not a valid member of Lightning “Lightning”]
My code is
local function Part3()
local Rain = Objectives.RainObjective.Rain:Clone()
local Lightning = Objectives.RainObjective.Lightning:Clone()
local Fire = Objectives.RainObjective.Fire:Clone()
wait(4)
TransitionEvent:FireAllClients()
wait(2)
Rain.Parent = game.Workspace
game.Lighting.TimeOfDay = 1
wait(3)
DialogueEvent:FireAllClients(NpcImage, NpcName, "It's raining! We should go back to the cabin!")
wait(4)
NpcModel.Humanoid:MoveTo(WalkToPoints.CabinPoint.Position)
NpcModel.Humanoid.MoveToFinished:Wait()
wait(4)
Lightning.Parent = game.Workspace
game.Lighting.ColorCorrection.Brightness = 0.5
game.Lighting.ColorCorrection.Contrast = 0.5
wait(3)
game.Lighting.ColorCorrection.Brightness = 0.08
game.Lighting.ColorCorrection.Contrast = 0.1
Lightning:Destroy()
Fire.Parent = game.Workspace
I searched on the developer forums and couldn’t find anything about it.
That means that for whatever reason “ColorCorrection” is not a child of your lightning. So when your code is looking for it it’s getting confused because it can’t find it.
I don’t particularly see an issue with what you’ve written. So it’s probably your hierarchy that’s wrong. Or somewhere else in the code.
The I will note that when you clone the lightning you should parent it. Right now it’s parent is nil. never mind, totally missed the line that parents it. And if the game.Workspace.Lightning is just the same lightning you cloned then you should just use the lightning variable instead of its path.
local function Part3()
local Rain = Objectives.RainObjective.Rain:Clone()
local Lightning = Objectives.RainObjective.Lightning:Clone()
local Fire = Objectives.RainObjective.Fire:Clone()
wait(4)
TransitionEvent:FireAllClients()
wait(2)
Rain.Parent = game.Workspace
game.Lighting.TimeOfDay = 1
wait(3)
DialogueEvent:FireAllClients(NpcImage, NpcName, "It's raining! We should go back to the cabin!")
wait(4)
NpcModel.Humanoid:MoveTo(WalkToPoints.CabinPoint.Position)
NpcModel.Humanoid.MoveToFinished:Wait()
wait(4)
Lightning.Parent = game.Workspace
workspace.RainObjective.Lighting.ColorCorrection.Brightness = 0.5
workspace.RainObjective.Lighting.ColorCorrection.Contrast = 0.5
wait(3)
workspace.RainObjective.Lighting.ColorCorrection.Brightness = 0.08
workspace.RainObjective.Lighting.ColorCorrection.Contrast = 0.1
Lightning:Destroy()
Fire.Parent = game.Workspace
Basically hit control F to pull up the search bar, and search for a lightning.ColorCorrection. That’s probably a typo and you mean Lighting.ColorCorrection. I don’t see it anywhere in your current code though.
Had no idea what that was the descendant of, probably lighting now that I think about it.
So you’d change workspace to “game.Lighting,” it should be:
local function Part3()
local Rain = Objectives.RainObjective.Rain:Clone()
local Lightning = Objectives.RainObjective.Lightning:Clone()
local Fire = Objectives.RainObjective.Fire:Clone()
wait(4)
TransitionEvent:FireAllClients()
wait(2)
Rain.Parent = game.Workspace
game.Lighting.TimeOfDay = 1
wait(3)
DialogueEvent:FireAllClients(NpcImage, NpcName, "It's raining! We should go back to the cabin!")
wait(4)
NpcModel.Humanoid:MoveTo(WalkToPoints.CabinPoint.Position)
NpcModel.Humanoid.MoveToFinished:Wait()
wait(4)
Lightning.Parent = game.Workspace
game.Lighting.RainObjective.Lighting.ColorCorrection.Brightness = 0.5
game.Lighting.RainObjective.Lighting.ColorCorrection.Contrast = 0.5
wait(3)
game.Lighting.RainObjective.Lighting.ColorCorrection.Brightness = 0.08
game.Lighting.RainObjective.Lighting.ColorCorrection.Contrast = 0.1
Lightning:Destroy()
Fire.Parent = game.Workspace
local function Part3()
local Rain = Objectives.RainObjective.Rain:Clone()
local Lightning = Objectives.RainObjective.Lightning:Clone()
local Fire = Objectives.RainObjective.Fire:Clone()
wait(4)
TransitionEvent:FireAllClients()
wait(2)
Rain.Parent = game.Workspace
game.Lighting.TimeOfDay = 1
wait(3)
DialogueEvent:FireAllClients(NpcImage, NpcName, "It's raining! We should go back to the cabin!")
wait(4)
NpcModel.Humanoid:MoveTo(WalkToPoints.CabinPoint.Position)
NpcModel.Humanoid.MoveToFinished:Wait()
wait(4)
Lightning.Parent = game.Workspace
game.ReplicatedStorage.Objectives.RainObjective.Lightning.ColorCorrection.Brightness = 0.5
game.ReplicatedStorage.Objectives.RainObjective.Lightning.ColorCorrection.Contrast = 0.5
wait(3)
game.ReplicatedStorage.Objectives.RainObjective.Lightning.ColorCorrection.Brightness = 0.08
game.ReplicatedStorage.Objectives.RainObjective.Lightning.ColorCorrection.Contrast = 0.1
Lightning:Destroy()
Fire.Parent = game.Workspace