Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I bring a skybox from serverStorage to lighting?

Asked by 8 years ago

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

???

0
serverStore and Lighting need to go before skybox 1 and 2 TheHospitalDev 1134 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago
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.

Ad

Answer this question