Solar system client side script
Key RequiredUniversal

Solar system client side script

Universal Scriptjersonlames2jersonlames2 684 views 135 executesUpdated Dec 30, 2025
Unrated
00
Lua Script•404 lines (13162 chars)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")

local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local rootPart = character:WaitForChild("HumanoidRootPart")

-- ==== Earth ====
local earth = Instance.new("Part")
earth.Shape = Enum.PartType.Ball
earth.Anchored = true
earth.CanCollide = false
earth.CastShadow = false
earth.Size = Vector3.new(5000, 5000, 5000)
earth.Position = Vector3.new(0, 0, 0)
earth.Material = Enum.Material.SmoothPlastic
earth.Parent = workspace
for _, face in ipairs(Enum.NormalId:GetEnumItems()) do
    local d = Instance.new("Decal")
    d.Texture = "rbxassetid://453515908"
    d.Face = face
    d.Parent = earth
end

-- ==== Moon ====
local moon = Instance.new("Part")
moon.Shape = Enum.PartType.Ball
moon.Anchored = true
moon.CanCollide = false
moon.CastShadow = false
moon.Size = Vector3.new(1200, 1200, 1200)
moon.Position = Vector3.new(-9000, 0, 0)
moon.Material = Enum.Material.Slate
moon.Parent = workspace
for _, face in ipairs(Enum.NormalId:GetEnumItems()) do
    local d = Instance.new("Decal")
    d.Texture = "rbxassetid://8159103611"
    d.Face = face
    d.Parent = moon
end
local moonFloor = Instance.new("Part")
moonFloor.Size = Vector3.new(1200, 10, 1200)
moonFloor.Anchored = true
moonFloor.Position = moon.Position - Vector3.new(0, 595, 0)
moonFloor.Transparency = 1
moonFloor.CanCollide = false
moonFloor.Color = moon.Color
moonFloor.Parent = workspace

-- ==== Mars ====
local mars = Instance.new("Part")
mars.Shape = Enum.PartType.Ball
mars.Anchored = true
mars.CanCollide = false
mars.CastShadow = false
mars.Size = Vector3.new(2000, 2000, 2000)
mars.Position = earth.Position + Vector3.new(-5000, 800, -20000)
mars.Material = Enum.Material.Slate
mars.Color = Color3.fromRGB(255,165,0)
mars.Parent = workspace
for _, face in ipairs(Enum.NormalId:GetEnumItems()) do
    local d = Instance.new("Decal")
    d.Texture = "rbxassetid://147706174"
    d.Face = face
    d.Parent = mars
end
local marsFloor = Instance.new("Part")
marsFloor.Size = Vector3.new(2000, 10, 2000)
marsFloor.Anchored = true
marsFloor.Position = mars.Position - Vector3.new(0, 1000, 0)
marsFloor.Transparency = 1
marsFloor.CanCollide = false
marsFloor.Color = mars.Color
marsFloor.Parent = workspace

-- ==== Sun ====
local sun = Instance.new("Part")
sun.Shape = Enum.PartType.Ball
sun.Anchored = true
sun.CanCollide = false
sun.CastShadow = false
sun.Size = Vector3.new(20000000, 20000000, 20000000)
sun.Position = Vector3.new(0, 0, 30000)
sun.Material = Enum.Material.Neon
sun.Color = Color3.fromRGB(255,255,0)
sun.Parent = workspace
local sunLight = Instance.new("PointLight")
sunLight.Brightness = 20
sunLight.Range = 2_000_000
sunLight.Parent = sun

-- ==== Mercury ====
local mercury = Instance.new("Part")
mercury.Shape = Enum.PartType.Ball
mercury.Anchored = true
mercury.CanCollide = false
mercury.CastShadow = false
mercury.Size = Vector3.new(800,800,800)
mercury.Position = sun.Position - Vector3.new(20000,0,0)
mercury.Material = Enum.Material.Slate
mercury.Color = Color3.fromRGB(128,128,128)
mercury.Parent = workspace
for _, face in ipairs(Enum.NormalId:GetEnumItems()) do
    local d = Instance.new("Decal")
    d.Texture = "rbxassetid://9228278194"
    d.Face = face
    d.Parent = mercury
end
local mercuryFloor = Instance.new("Part")
mercuryFloor.Size = Vector3.new(800,10,800)
mercuryFloor.Anchored = true
mercuryFloor.Position = mercury.Position - Vector3.new(0,395,0)
mercuryFloor.Transparency = 1
mercuryFloor.CanCollide = false
mercuryFloor.Color = mercury.Color
mercuryFloor.Parent = workspace

-- ==== Venus ====
local venus = Instance.new("Part")
venus.Shape = Enum.PartType.Ball
venus.Anchored = true
venus.CanCollide = false
venus.CastShadow = false
venus.Size = Vector3.new(950, 950, 950)
venus.Position = sun.Position + Vector3.new(35000, 0, 0)
venus.Material = Enum.Material.Slate
venus.Color = Color3.fromRGB(227, 207, 87)
venus.Parent = workspace
for _, face in ipairs(Enum.NormalId:GetEnumItems()) do
    local d = Instance.new("Decal")
    d.Texture = "rbxassetid://137774450"
    d.Face = face
    d.Parent = venus
end
local venusFloor = Instance.new("Part")
venusFloor.Size = Vector3.new(950,10,950)
venusFloor.Anchored = true
venusFloor.Position = venus.Position - Vector3.new(0,475,0)
venusFloor.Transparency = 1
venusFloor.CanCollide = false
venusFloor.Color = venus.Color
venusFloor.Parent = workspace

-- ==== Neptune ====
local neptune = Instance.new("Part")
neptune.Shape = Enum.PartType.Ball
neptune.Anchored = true
neptune.CanCollide = true
neptune.CastShadow = false
neptune.Size = Vector3.new(4000, 4000, 4000)
neptune.Position = earth.Position + Vector3.new(0, 0, -30000)
neptune.Material = Enum.Material.Slate
neptune.Color = Color3.fromRGB(72, 61, 139)
neptune.Parent = workspace
for _, face in ipairs(Enum.NormalId:GetEnumItems()) do
    local d = Instance.new("Decal")
    d.Texture = "rbxassetid://136126670"
    d.Face = face
    d.Parent = neptune
end
local neptuneFloor = Instance.new("Part")
neptuneFloor.Size = Vector3.new(4000, 10, 4000)
neptuneFloor.Anchored = true
neptuneFloor.Position = neptune.Position - Vector3.new(0, 2000, 0)
neptuneFloor.Transparency = 1
neptuneFloor.CanCollide = true
neptuneFloor.Color = neptune.Color
neptuneFloor.Parent = workspace

-- ==== Saturn ====
local saturn = Instance.new("Part")
saturn.Shape = Enum.PartType.Ball
saturn.Anchored = true
saturn.CanCollide = true
saturn.CastShadow = false
saturn.Size = Vector3.new(7000, 7000, 7000)
saturn.Position = neptune.Position + Vector3.new(8000, 0, 0)
saturn.Material = Enum.Material.Sand
saturn.Color = Color3.fromRGB(255, 215, 0)
saturn.Parent = workspace
for _, face in ipairs(Enum.NormalId:GetEnumItems()) do
    local d = Instance.new("Decal")
    d.Texture = "rbxassetid://136126670"
    d.Face = face
    d.Parent = saturn
end
local saturnFloor = Instance.new("Part")
saturnFloor.Size = Vector3.new(7000, 10, 7000)
saturnFloor.Anchored = true
saturnFloor.Position = saturn.Position - Vector3.new(0, 3500, 0)
saturnFloor.Transparency = 1
saturnFloor.CanCollide = false
saturnFloor.Color = saturn.Color
saturnFloor.Parent = workspace

-- ==== Saturn Smoke Ring ====
local smokeCount = 60
local ringRadius = 9500 -- Slightly bigger to match new mesh
local ringHeight = 0
local saturnSmokeParts = {}

for i = 1, smokeCount do
    local angle = (2 * math.pi / smokeCount) * i
    local x = math.cos(angle) * ringRadius
    local z = math.sin(angle) * ringRadius

    local part = Instance.new("Part")
    part.Size = Vector3.new(1,1,1)
    part.Anchored = true
    part.CanCollide = false
    part.Transparency = 1
    part.CFrame = saturn.CFrame * CFrame.new(x, ringHeight, z)
    part.Parent = workspace

    local smoke = Instance.new("Smoke")
    smoke.RiseVelocity = 0
    smoke.Size = 15
    smoke.Opacity = 0.7
    smoke.Color = Color3.fromRGB(255, 215, 0)
    smoke.Parent = part

    table.insert(saturnSmokeParts, part)
end

-- ==== Saturn Ring Mesh (torus) ====
local saturnRing = Instance.new("Part")
saturnRing.Anchored = true
saturnRing.CanCollide = false
saturnRing.CastShadow = false
saturnRing.Position = saturn.Position
saturnRing.Size = Vector3.new(1,1,1)
saturnRing.Transparency = 0.3
saturnRing.Material = Enum.Material.SmoothPlastic
saturnRing.Color = Color3.fromRGB(255, 215, 0) -- Gold yellowish
saturnRing.Parent = workspace

local ringMesh = Instance.new("SpecialMesh")
ringMesh.MeshType = Enum.MeshType.FileMesh
ringMesh.MeshId = "rbxassetid://166706306"
ringMesh.TextureId = "" -- plain color
ringMesh.Scale = Vector3.new(25, 2, 25) -- Bigger to fully surround Saturn
ringMesh.Parent = saturnRing

-- ==== Planet rotations ====
local earthRot = 2
local marsRot = 1
local mercuryRot = 1.5
local venusRot = 1.2
local neptuneRot = 0.8
local saturnRot = 0.7

-- ==== Map hide ====
local hideDistance = 1100
local mapParts = {}

for _, p in ipairs(workspace:GetDescendants()) do
    if p:IsA("BasePart")
    and not p:IsDescendantOf(character)
    and p ~= earth and p ~= moon and p ~= mars and p ~= sun and p ~= mercury and p ~= venus and p ~= neptune and p ~= saturn
    and p ~= moonFloor and p ~= marsFloor and p ~= mercuryFloor and p ~= venusFloor and p ~= neptuneFloor and p ~= saturnFloor and p ~= saturnRing then
        table.insert(mapParts, p)
    end
end

-- ==== Lighting backup ====
local oAmb = Lighting.Ambient
local oOut = Lighting.OutdoorAmbient
local oTime = Lighting.ClockTime

-- ==== Inside checks ====
local function inside(part)
    return (rootPart.Position - part.Position).Magnitude <= part.Size.X/2
end

-- ==== Gas planet warning ====
local function showWarning(text)
    local gui = Instance.new("BillboardGui")
    gui.Adornee = rootPart
    gui.Size = UDim2.new(0, 200, 0, 50)
    gui.StudsOffset = Vector3.new(0, 5, 0)
    gui.AlwaysOnTop = true

    local label = Instance.new("TextLabel")
    label.Size = UDim2.new(1,0,1,0)
    label.BackgroundTransparency = 1
    label.TextColor3 = Color3.fromRGB(255,0,0)
    label.TextStrokeTransparency = 0
    label.TextScaled = true
    label.Text = text
    label.Parent = gui

    gui.Parent = player:WaitForChild("PlayerGui")

    delay(2, function()
        gui:Destroy()
    end)
end

local function onTouched(part, planetName)
    if part == rootPart then
        showWarning("You can't get inside " .. planetName .. " since it's a gas planet.")
    end
end

neptune.Touched:Connect(function(hit) onTouched(hit, "Neptune") end)
saturn.Touched:Connect(function(hit) onTouched(hit, "Saturn") end)

-- ==== Main loop ====
RunService.RenderStepped:Connect(function(dt)
    -- Rotate planets
    earth.CFrame = earth.CFrame * CFrame.Angles(0, math.rad(earthRot*dt), 0)
    mars.CFrame = mars.CFrame * CFrame.Angles(0, math.rad(marsRot*dt), 0)
    mercury.CFrame = mercury.CFrame * CFrame.Angles(0, math.rad(mercuryRot*dt), 0)
    venus.CFrame = venus.CFrame * CFrame.Angles(0, math.rad(venusRot*dt), 0)
    neptune.CFrame = neptune.CFrame * CFrame.Angles(0, math.rad(neptuneRot*dt), 0)
    saturn.CFrame = saturn.CFrame * CFrame.Angles(0, math.rad(saturnRot*dt), 0)
    saturnRing.CFrame = saturn.CFrame

    -- Update smoke ring positions to follow Saturn
    for i, part in ipairs(saturnSmokeParts) do
        local angle = (2 * math.pi / smokeCount) * i
        local x = math.cos(angle) * ringRadius
        local z = math.sin(angle) * ringRadius
        part.CFrame = saturn.CFrame * CFrame.new(x, ringHeight, z)
    end

    -- Distance & inside checks
    local distEarth = (rootPart.Position - earth.Position).Magnitude
    local inEarth = inside(earth)
    local inMoon = inside(moon)
    local inMars = inside(mars)
    local inMercury = inside(mercury)
    local inVenus = inside(venus)
    local inNeptune = inside(neptune)
    local inSaturn = inside(saturn)

    -- Hide planets if inside Earth
    mars.Transparency = inEarth and 1 or 0
    mercury.Transparency = inEarth and 1 or 0
    venus.Transparency = inEarth and 1 or 0
    neptune.Transparency = inEarth and 1 or 0
    saturn.Transparency = inEarth and 1 or 0
    saturnRing.Transparency = inEarth and 0.3 or 0.3
    for _, part in ipairs(saturnSmokeParts) do
        part.Transparency = inEarth and 1 or 0
    end

    -- Hide map parts if far
    if distEarth >= hideDistance then
        for _, p in ipairs(mapParts) do
            p.Transparency = 1
            p.CanCollide = false
        end

        venus.Transparency = 0
        workspace.Gravity = 0

        -- Floors and gravity
        moonFloor.Transparency = inMoon and 0 or 1
        moonFloor.CanCollide = inMoon
        marsFloor.Transparency = inMars and 0 or 1
        marsFloor.CanCollide = inMars
        mercuryFloor.Transparency = inMercury and 0 or 1
        mercuryFloor.CanCollide = inMercury
        venusFloor.Transparency = inVenus and 0 or 1
        venusFloor.CanCollide = inVenus
        neptuneFloor.Transparency = inNeptune and 0 or 1
        neptuneFloor.CanCollide = inNeptune
        saturnFloor.Transparency = inSaturn and 0 or 1
        saturnFloor.CanCollide = inSaturn

        workspace.Gravity = inMoon and 196.2*(1.62/9.81)
                        or inMars and 196.2*0.378
                        or inMercury and 196.2*0.38
                        or inVenus and 196.2*0.904
                        or inNeptune and 196.2*1.14
                        or inSaturn and 196.2*1.06
                        or 0

        Lighting.ClockTime = 0
        Lighting.Ambient = Color3.fromRGB(30,30,40)
        Lighting.OutdoorAmbient = Color3.fromRGB(20,20,30)
    else
        -- Near Earth: show everything
        for _, p in ipairs(mapParts) do
            p.Transparency = 0
            p.CanCollide = true
        end

        moonFloor.Transparency = 1
        marsFloor.Transparency = 1
        mercuryFloor.Transparency = 1
        venusFloor.Transparency = 1
        neptuneFloor.Transparency = 1
        saturnFloor.Transparency = 1

        workspace.Gravity = 196.2

        Lighting.ClockTime = oTime
        Lighting.Ambient = oAmb
        Lighting.OutdoorAmbient = oOut
    end
end)

Features & Information

Solar system remake go to the sky to visit planets (added Saturn) You need to go to space to see planets

Community Comments (5)

jersonlames2jersonlames2Dec 30, 2025

Hi guys this is awful66641 You just need to go to the sky to visit the solar system I didn't add more planets since it's unfinished

jersonlames2jersonlames2Dec 30, 2025

also this isn't Fe tho ):

jersonlames2jersonlames2Jan 1, 2026

Saturn rings are missing It will be added soon.

Hellogoovy727Hellogoovy727Apr 1, 2026

Please dont use this anymore this is my other account I'm gonna make a rework one coming soon!

Hellogoovy727Hellogoovy727Apr 1, 2026

I'm not longer updating this.

More Scripts for Universal Scripts