sky changer
Key RequiredUniversal

sky changer

Universal Scriptacaymanuel16acaymanuel16 1.2K views 1.5K executesUpdated Mar 23, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•375 lines (10465 chars)
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
local Lighting = game:GetService("Lighting")

local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")

if PlayerGui:FindFirstChild("SkyChangerGUI") then
	PlayerGui:FindFirstChild("SkyChangerGUI"):Destroy()
end

local OriginalSkyData = nil
local ExistingSky = Lighting:FindFirstChildOfClass("Sky")

if ExistingSky then
	OriginalSkyData = {
		SkyboxBk = ExistingSky.SkyboxBk,
		SkyboxDn = ExistingSky.SkyboxDn,
		SkyboxFt = ExistingSky.SkyboxFt,
		SkyboxLf = ExistingSky.SkyboxLf,
		SkyboxRt = ExistingSky.SkyboxRt,
		SkyboxUp = ExistingSky.SkyboxUp,
		SunTextureId = ExistingSky.SunTextureId,
		MoonTextureId = ExistingSky.MoonTextureId,
		StarCount = ExistingSky.StarCount,
		CelestialBodiesShown = ExistingSky.CelestialBodiesShown,
	}
end

local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "SkyChangerGUI"
ScreenGui.Parent = PlayerGui
ScreenGui.ResetOnSpawn = false
ScreenGui.IgnoreGuiInset = true

local Main = Instance.new("Frame")
Main.Parent = ScreenGui
Main.Size = UDim2.new(0, 340, 0, 182)
Main.Position = UDim2.new(0.5, -170, 0.5, -91)
Main.BackgroundColor3 = Color3.fromRGB(18, 18, 18)
Main.BorderSizePixel = 0

local MainCorner = Instance.new("UICorner", Main)
MainCorner.CornerRadius = UDim.new(0, 14)

local MainStroke = Instance.new("UIStroke", Main)
MainStroke.Color = Color3.fromRGB(60, 60, 60)
MainStroke.Thickness = 1.2

local Shadow = Instance.new("ImageLabel")
Shadow.Parent = Main
Shadow.BackgroundTransparency = 1
Shadow.Size = UDim2.new(1, 30, 1, 30)
Shadow.Position = UDim2.new(0, -15, 0, -15)
Shadow.ZIndex = 0
Shadow.Image = "rbxassetid://1316045217"
Shadow.ImageTransparency = 0.55
Shadow.ScaleType = Enum.ScaleType.Slice
Shadow.SliceCenter = Rect.new(10, 10, 118, 118)

local TopBar = Instance.new("Frame")
TopBar.Parent = Main
TopBar.Size = UDim2.new(1, 0, 0, 38)
TopBar.BackgroundColor3 = Color3.fromRGB(24, 24, 24)
TopBar.BorderSizePixel = 0

local TopCorner = Instance.new("UICorner", TopBar)
TopCorner.CornerRadius = UDim.new(0, 14)

local Fix = Instance.new("Frame")
Fix.Parent = TopBar
Fix.Size = UDim2.new(1, 0, 0, 12)
Fix.Position = UDim2.new(0, 0, 1, -12)
Fix.BackgroundColor3 = Color3.fromRGB(24, 24, 24)
Fix.BorderSizePixel = 0

local Title = Instance.new("TextLabel")
Title.Parent = TopBar
Title.BackgroundTransparency = 1
Title.Position = UDim2.new(0, 12, 0, 0)
Title.Size = UDim2.new(1, -90, 1, 0)
Title.Font = Enum.Font.GothamBold
Title.Text = "Sky Changer"
Title.TextColor3 = Color3.fromRGB(255, 255, 255)
Title.TextSize = 15
Title.TextXAlignment = Enum.TextXAlignment.Left

local Close = Instance.new("ImageButton")
Close.Parent = TopBar
Close.Size = UDim2.new(0, 24, 0, 24)
Close.Position = UDim2.new(1, -32, 0.5, -12)
Close.BackgroundTransparency = 1
Close.Image = "rbxassetid://17186557205"

local Minimize = Instance.new("ImageButton")
Minimize.Parent = TopBar
Minimize.Size = UDim2.new(0, 22, 0, 22)
Minimize.Position = UDim2.new(1, -62, 0.5, -11)
Minimize.BackgroundTransparency = 1
Minimize.Image = "rbxassetid://11644512450"

local Input = Instance.new("TextBox")
Input.Parent = Main
Input.Size = UDim2.new(1, -24, 0, 40)
Input.Position = UDim2.new(0, 12, 0, 55)
Input.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
Input.BorderSizePixel = 0
Input.PlaceholderText = "Digite ID, link ou rbxassetid"
Input.Text = ""
Input.ClearTextOnFocus = false
Input.Font = Enum.Font.Gotham
Input.TextSize = 14
Input.TextColor3 = Color3.fromRGB(255, 255, 255)
Input.PlaceholderColor3 = Color3.fromRGB(140, 140, 140)

local InputCorner = Instance.new("UICorner", Input)
InputCorner.CornerRadius = UDim.new(0, 10)

local InputStroke = Instance.new("UIStroke", Input)
InputStroke.Color = Color3.fromRGB(55, 55, 55)
InputStroke.Thickness = 1

local Inject = Instance.new("TextButton")
Inject.Parent = Main
Inject.Size = UDim2.new(1, -24, 0, 32)
Inject.Position = UDim2.new(0, 12, 0, 104)
Inject.BackgroundColor3 = Color3.fromRGB(45, 110, 255)
Inject.BorderSizePixel = 0
Inject.Text = "INJETAR CÉU"
Inject.Font = Enum.Font.GothamBold
Inject.TextSize = 14
Inject.TextColor3 = Color3.fromRGB(255, 255, 255)

local InjectCorner = Instance.new("UICorner", Inject)
InjectCorner.CornerRadius = UDim.new(0, 10)

local Reset = Instance.new("TextButton")
Reset.Parent = Main
Reset.Size = UDim2.new(1, -24, 0, 28)
Reset.Position = UDim2.new(0, 12, 0, 141)
Reset.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
Reset.BorderSizePixel = 0
Reset.Text = "RESTAURAR CÉU"
Reset.Font = Enum.Font.GothamBold
Reset.TextSize = 13
Reset.TextColor3 = Color3.fromRGB(255, 255, 255)

local ResetCorner = Instance.new("UICorner", Reset)
ResetCorner.CornerRadius = UDim.new(0, 10)

local FloatButton = Instance.new("ImageButton")
FloatButton.Parent = ScreenGui
FloatButton.Size = UDim2.new(0, 58, 0, 58)
FloatButton.Position = UDim2.new(0, 20, 0.5, -29)
FloatButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
FloatButton.BorderSizePixel = 0
FloatButton.Image = "rbxassetid://131063369441851"
FloatButton.Visible = false

local FloatCorner = Instance.new("UICorner", FloatButton)
FloatCorner.CornerRadius = UDim.new(1, 0)

local FloatStroke = Instance.new("UIStroke", FloatButton)
FloatStroke.Color = Color3.fromRGB(70, 70, 70)
FloatStroke.Thickness = 1.2

local FloatShadow = Instance.new("ImageLabel")
FloatShadow.Parent = FloatButton
FloatShadow.BackgroundTransparency = 1
FloatShadow.Size = UDim2.new(1, 24, 1, 24)
FloatShadow.Position = UDim2.new(0, -12, 0, -12)
FloatShadow.ZIndex = 0
FloatShadow.Image = "rbxassetid://1316045217"
FloatShadow.ImageTransparency = 0.6
FloatShadow.ScaleType = Enum.ScaleType.Slice
FloatShadow.SliceCenter = Rect.new(10, 10, 118, 118)

local function extractAssetId(text)
	text = tostring(text or ""):gsub("%s+", "")

	if text == "" then
		return nil
	end

	local direct = text:match("^rbxassetid://(%d+)$")
	if direct then
		return direct
	end

	local idParam = text:match("[?&]id=(%d+)")
	if idParam then
		return idParam
	end

	local library = text:match("/library/(%d+)")
	if library then
		return library
	end

	local decal = text:match("/catalog/(%d+)")
	if decal then
		return decal
	end

	local raw = text:match("(%d+)")
	if raw then
		return raw
	end

	return nil
end

local function getOrCreateSky()
	local sky = Lighting:FindFirstChild("CustomSkyChanger")
	if not sky then
		sky = Instance.new("Sky")
		sky.Name = "CustomSkyChanger"
		sky.Parent = Lighting
	end
	return sky
end

local function applySky(rawInput)
	local id = extractAssetId(rawInput)
	if not id then
		Input.Text = "ID inválido"
		return
	end

	local asset = "rbxassetid://" .. id
	local sky = getOrCreateSky()

	local ok = pcall(function()
		sky.SkyboxBk = asset
		sky.SkyboxDn = asset
		sky.SkyboxFt = asset
		sky.SkyboxLf = asset
		sky.SkyboxRt = asset
		sky.SkyboxUp = asset
		sky.SunTextureId = ""
		sky.MoonTextureId = ""
		sky.StarCount = 0
		sky.CelestialBodiesShown = false
	end)

	if ok then
		Input.Text = id
	else
		Input.Text = "Falhou nesse asset"
	end
end

local function restoreSky()
	local custom = Lighting:FindFirstChild("CustomSkyChanger")
	if custom then
		custom:Destroy()
	end

	local currentSky = Lighting:FindFirstChildOfClass("Sky")
	if not currentSky then
		currentSky = Instance.new("Sky")
		currentSky.Parent = Lighting
	end

	if OriginalSkyData then
		pcall(function()
			currentSky.SkyboxBk = OriginalSkyData.SkyboxBk
			currentSky.SkyboxDn = OriginalSkyData.SkyboxDn
			currentSky.SkyboxFt = OriginalSkyData.SkyboxFt
			currentSky.SkyboxLf = OriginalSkyData.SkyboxLf
			currentSky.SkyboxRt = OriginalSkyData.SkyboxRt
			currentSky.SkyboxUp = OriginalSkyData.SkyboxUp
			currentSky.SunTextureId = OriginalSkyData.SunTextureId
			currentSky.MoonTextureId = OriginalSkyData.MoonTextureId
			currentSky.StarCount = OriginalSkyData.StarCount
			currentSky.CelestialBodiesShown = OriginalSkyData.CelestialBodiesShown
		end)
	end
end

local function tween(obj, info, props)
	return TweenService:Create(obj, info, props)
end

Inject.MouseButton1Click:Connect(function()
	applySky(Input.Text)
end)

Input.FocusLost:Connect(function(enterPressed)
	if enterPressed then
		applySky(Input.Text)
	end
end)

Reset.MouseButton1Click:Connect(function()
	restoreSky()
end)

Minimize.MouseButton1Click:Connect(function()
	local hideTween = tween(Main, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
		Size = UDim2.new(0, 340, 0, 0),
		BackgroundTransparency = 0.15
	})
	hideTween:Play()
	hideTween.Completed:Wait()
	Main.Visible = false
	Main.Size = UDim2.new(0, 340, 0, 182)
	Main.BackgroundTransparency = 0
	FloatButton.Visible = true
	FloatButton.Size = UDim2.new(0, 0, 0, 0)
	tween(FloatButton, TweenInfo.new(0.2, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
		Size = UDim2.new(0, 58, 0, 58)
	}):Play()
end)

FloatButton.MouseButton1Click:Connect(function()
	Main.Visible = true
	Main.Size = UDim2.new(0, 340, 0, 0)
	tween(Main, TweenInfo.new(0.22, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
		Size = UDim2.new(0, 340, 0, 182)
	}):Play()
	FloatButton.Visible = false
end)

Close.MouseButton1Click:Connect(function()
	ScreenGui:Destroy()
end)

local function makeDraggable(dragObject, moveObject)
	local dragging = false
	local dragStart
	local startPos

	local function update(input)
		local delta = input.Position - dragStart
		moveObject.Position = UDim2.new(
			startPos.X.Scale,
			startPos.X.Offset + delta.X,
			startPos.Y.Scale,
			startPos.Y.Offset + delta.Y
		)
	end

	dragObject.InputBegan:Connect(function(input)
		if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
			dragging = true
			dragStart = input.Position
			startPos = moveObject.Position

			input.Changed:Connect(function()
				if input.UserInputState == Enum.UserInputState.End then
					dragging = false
				end
			end)
		end
	end)

	dragObject.InputChanged:Connect(function(input)
		if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
			if dragging then
				update(input)
			end
		end
	end)

	UserInputService.InputChanged:Connect(function(input)
		if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
			update(input)
		end
	end)
end

makeDraggable(TopBar, Main)
makeDraggable(FloatButton, FloatButton)

Features & Information

change sky of games using texture ids!

Community Comments (1)

acaymanuel16acaymanuel16Mar 23, 2026

0 key

More Scripts for Universal Scripts