So I’m making a horror game that will have 2 different skies in Lighting, mainly a Yellow sky combined with an Atmosphere to give it cool little Yellow fog effect. The thing is, once you go inside the game maze I want the Yellow one to disable and switch over to the other Black sky I have.
Normal appearance (Using the game thumbnail to show what it looks like with the yellow sky since I’m too lazy to go in studio for a new screenshot).
The thing is that I can’t really find any tutorials touching around my question as I mainly guide myself off of scripting tutorials since I don’t know how to myself. Is the any example on how the supposed code would look? At least something that I can try building off of.
This is some pseudocode, you can figure out the exact formatting from here:
local Lighting = game:GetService("Lighting")
Lighting.AttributeChanged:Connect(function(a)
if a == "Switch" then
local att = Lighting:GetAttribute(a)
local oldSky = Lighting:FindFirstChildOfClass("Sky")
local newSky = game:GetService("ServerStorage"):FindFirstChild(att):Clone()
newSky.Parent = Lighting
oldSky:Destroy()
end
end)