Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I bring a skybox from serverStorage to lighting?

I'm trying to make a script to bring a skybox from serverstorage to lighting and the previous skybox to serverstorage, but it's not working.

while true do
	
	local skybox1 = game.lighting:FindFirstChild("Purple Nebula")
	local skybox2 = game.serverStore:FindFirstChild("Dark Skies")	
	local serverStore = game:GetService("ServerStorage") 
	Lighting = game.Lighting
	
	wait(5)
	skybox1.Parent = serverStore
	skybox2.Parent = Lighting
	wait(1)
	skybox2.Parent = serverStore
	skybox1.Parent = Lighting

end

???

1 comment

0

serverStore and Lighting need to go before skybox 1 and 2

1 answer

if script.Parent.Parent ~= game.Lighting then
script.Parent.Parent = game.Lighting
end

Hope this helps, pretty sure that would work. That would be if you were inserting the script into the actual skybox though. Otherwise, you'd put if game.Workspace.serverStore.skybox2.Parent ~= Lighting then rather than if script.Parent.Parent ~= game.Lighting then, so

if game.Workspace.serverStore.skybox2.Parent ~= Lighting then
game.Workspace.serverStore.skybox2.Parent = Lighting
end

should hopefully do the trick.

This discussion is preserved as it was. New answers, comments, and votes are closed.