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

Someone help me to fix the SkyBox for planets?

local Skyboxes = {
    Earth = {
        SkyboxBk = "http://www.roblox.com/asset/?id=225469345" -- Id here
     
    }
}
Earth = {
        SkyboxDn = "http://www.roblox.com/asset/?id=225469349" -- Id here
        
   }
Earth = {
        SkyboxFt = "http://www.roblox.com/asset/?id=225469359" -- Id here
        
 }
Earth = {
        SkyboxLf = "http://www.roblox.com/asset/?id=225469364" -- Id here
        
 }
Earth = {
        SkyboxRt = "http://www.roblox.com/asset/?id=225469372" -- Id here
        
 }
Earth = {
        SkyboxUp = "http://www.roblox.com/asset/?id=225469380" -- Id here
        
 }
local Input = script.Parent.Ilhas["Earth"] -- This is an example for getting the planet

if Skyboxes[Input] then
game.Lighting.Skybox.SkyboxBk = Skyboxes[Input]["SkyboxBk"]
game.Lighting.Skybox.SkyboxDn = Skyboxes[Input]["SkyboxDn"]
game.Lighting.Skybox.SkyboxFt = Skyboxes[Input]["SkyboxFt"]
game.Lighting.Skybox.SkyboxLf = Skyboxes[Input]["SkyboxLf"]
game.Lighting.Skybox.SkyboxRt = Skyboxes[Input]["SkyboxRt"]
game.Lighting.Skybox.SkyboxUp = Skyboxes[Input]["SkyboxUp"]
end

Does not work this script, to put skybox on the planets. like you enter the planet skybox change to the different skybox on the planet, it didn't work.

1 answer

✓ Accepted answer

first of all this is how the array/table/dict should be

local Skyboxes = {
   	Earth  = {
		SkyboxBk = "http://www.roblox.com/asset/?id=225469345",
		SkyboxDn = "http://www.roblox.com/asset/?id=225469349",
 		SkyboxFt = "http://www.roblox.com/asset/?id=225469359",
		SkyboxLf = "http://www.roblox.com/asset/?id=225469364",
 		SkyboxRt = "http://www.roblox.com/asset/?id=225469372",
		SkyboxUp = "http://www.roblox.com/asset/?id=225469380"
 	},
	ExampleMars = {}
}

local Input = "Earth" -- what you posted does not what you think it does

if Skyboxes[Input] then
	game.Lighting.Skybox.SkyboxBk = Skyboxes[Input]["SkyboxBk"]
	game.Lighting.Skybox.SkyboxDn = Skyboxes[Input]["SkyboxDn"]
	game.Lighting.Skybox.SkyboxFt = Skyboxes[Input]["SkyboxFt"]
	game.Lighting.Skybox.SkyboxLf = Skyboxes[Input]["SkyboxLf"]
	game.Lighting.Skybox.SkyboxRt = Skyboxes[Input]["SkyboxRt"]
	game.Lighting.Skybox.SkyboxUp = Skyboxes[Input]["SkyboxUp"]
end

more info on dictionaries and here more info on tables

1 comment

0

it changes sky to sky on the planet for example after entering the planet?

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