Hello, as the title explains, I need help on changing the skybox asset id. There are no errors in output.
local rng = 1
while wait(15) do
if rng == 1 then
print("Rain Has Occured")
game.Lighting.Sky.SkyboxBk = "http://www.roblox.com/asset/?id=10258337305"
game.Lighting.Sky.SkyboxDn = "http://www.roblox.com/asset/?id=10258337305"
game.Lighting.Sky.SkyboxFt = "http://www.roblox.com/asset/?id=10258337305"
game.Lighting.Sky.SkyboxLf = "http://www.roblox.com/asset/?id=10258337305"
--E.T.C.
end
end
Thank you!
You are using the wrong format, the correct one would be
local rng = 1
while wait(15) do
if rng == 1 then
print("Rain Has Occured")
game.Lighting.Sky.SkyboxBk = "rbxassetid://10258337305"
game.Lighting.Sky.SkyboxDn = "rbxassetid://10258337305"
game.Lighting.Sky.SkyboxFt = "rbxassetid://10258337305"
game.Lighting.Sky.SkyboxLf = "rbxassetid://10258337305"
--E.T.C.
end
end
1 Like
I used your code, does not work. Although it changed the asset id, it did not change the sky
Well, it works if you do it manually, but i have no idea how to do it in a script
Alright, I will try to figure it out myself then
If you have both skies with their respective skybox textures stored in ServerStorage, than you can call :Destroy()
on the current sky and :Clone()
the new skybox and set it’s parent to Lighting
.
I will just use .Parent =
instead of cloning. Or if that does not work, I will just use your idea. I will mark it as the solution in 8hrs, as it is night in my area.
local rng = 1
task.spawn(function()
while wait(15) do
if rng == 1 then
print("Rain Has Occured")
game.Lighting.Sky.SkyboxBk = "http://www.roblox.com/asset/?id=10258337305"
game.Lighting.Sky.SkyboxDn = "http://www.roblox.com/asset/?id=10258337305"
game.Lighting.Sky.SkyboxFt = "http://www.roblox.com/asset/?id=10258337305"
game.Lighting.Sky.SkyboxLf = "http://www.roblox.com/asset/?id=10258337305"
--E.T.C.
end
end
end)
smth like that
That could work, but I’d use Megabyte’s idea. Why? Cause its simpler than having to write every single asset id for every side of the sky.