CelestialBodiesShown (Property)

From Legacy Roblox Wiki
(Redirected from CelestialBodiesShown)
Jump to navigationJump to search
CelestialBodiesShown
Property Bool
Description If true, the sun, moon, and stars will show.
Member of Sky
Example
Here's a Script that makes a button. When that button is pressed, toggles CelestialBodiesShown.
local button = Instance.new( "Part", Workspace )
local sky = Instance.new( "Sky", game.Lighting )

button.Position = Vector3.new()

function onTouched( hit )
   if not game.Players:GetPlayerFromCharacter( hit.Parent ) then
      return
   end

   sky.CelestialBodiesShown = not sky.CelestialBodiesShown
end

button.Touched:connect( onTouched )