Hello! I am trying to change the Fog End property of lighting through a script but it doesn’t work. No errors.
Here is the script:
local debounce = false
local lighting = game:GetService("Lighting")
script.Parent.Touched:Connect(function(hit)
if debounce == false then
debounce = true
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
wait(0.5)
game.Workspace.Bedroom.Radio["Happy Song"]:Stop()
game.Workspace.Bedroom.InvisWall.Transparency = 0
game.Workspace.Bedroom.InvisWall.CanCollide = true
game.Workspace.Bedroom.Door:Destroy()
wait(1)
for i,bulb in pairs(game.Workspace.Hallways.Bulbs.Working:GetChildren()) do
bulb.Model.Bulb.PointLight.Brightness = 0
bulb.Model.Bulb.LightsOut:Play()
wait(0.2)
end
wait(0.5)
lighting.FogEnd = 10
game.SoundService.LightsOut:Play()
end
end
end)