Can you provide more of the script? This on its own shouldn’t be causing anything. It sounds like the Atmosphere is getting :Destroy()ed at some point, since using Destroy locks the parent.
Once a lighting changer textbutton is clicked, it puts lighting elements as childrens of ligthing
then when another lighting changer textbutton is clicked, it deletes those elements with an if statement, checking if it already exists. then adds in the lighting elements.
This is a sample of the script that deletes the children of lighting
function OnClicked()
wait(0.5)
local c = game:GetService("Lighting"):GetChildren()
for i = 1,#c do
if c[i].ClassName == "Atmosphere" then
c[i]:Destroy()
end
end
end
script.Parent.MouseButton1Down:connect(OnClicked)