Universal God Mode READ THE DESCRIPTION
Key RequiredUniversal

Universal God Mode READ THE DESCRIPTION

Universal Scriptyusuftayyipacikgoz4yusuftayyipacikgoz4 1.2K views 943 executesUpdated Jan 23, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•164 lines (3968 chars)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

-- 🔴 CHANGE THIS
local TARGET_USER_ID = 123456789

local godEnabled = false
local healthLoop

-- ==============================
-- GOD MODE LOGIC
-- ==============================

local function enableGod(character)
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if not humanoid then return end

	humanoid.MaxHealth = math.huge
	humanoid.Health = humanoid.MaxHealth

	humanoid.HealthChanged:Connect(function()
		if godEnabled and humanoid.Health < humanoid.MaxHealth then
			humanoid.Health = humanoid.MaxHealth
		end
	end)

	healthLoop = RunService.Heartbeat:Connect(function()
		if godEnabled and humanoid.Health < humanoid.MaxHealth then
			humanoid.Health = humanoid.MaxHealth
		end
	end)
end

local function disableGod(character)
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if humanoid then
		humanoid.MaxHealth = 100
		humanoid.Health = humanoid.MaxHealth
	end
	if healthLoop then
		healthLoop:Disconnect()
		healthLoop = nil
	end
end

-- ==============================
-- GUI CREATION
-- ==============================

local function createGui(player)
	local gui = Instance.new("ScreenGui")
	gui.Name = "ServerGodModeGui"
	gui.ResetOnSpawn = false

	local frame = Instance.new("Frame")
	frame.Size = UDim2.new(0, 140, 0, 50)
	frame.Position = UDim2.new(0.05, 0, 0.4, 0)
	frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
	frame.BorderSizePixel = 0
	frame.Active = true
	frame.Draggable = false
	frame.Parent = gui

	local corner = Instance.new("UICorner", frame)
	corner.CornerRadius = UDim.new(0, 8)

	local button = Instance.new("TextButton")
	button.Size = UDim2.new(1, -10, 1, -10)
	button.Position = UDim2.new(0, 5, 0, 5)
	button.Text = "GOD: OFF"
	button.BackgroundColor3 = Color3.fromRGB(160, 0, 0)
	button.TextColor3 = Color3.new(1,1,1)
	button.Font = Enum.Font.GothamBold
	button.TextScaled = true
	button.Parent = frame

	button.MouseButton1Click:Connect(function()
		godEnabled = not godEnabled
		if godEnabled then
			button.Text = "GOD: ON"
			button.BackgroundColor3 = Color3.fromRGB(0, 160, 0)
			if player.Character then
				enableGod(player.Character)
			end
		else
			button.Text = "GOD: OFF"
			button.BackgroundColor3 = Color3.fromRGB(160, 0, 0)
			if player.Character then
				disableGod(player.Character)
			end
		end
	end)

	-- ==============================
	-- DRAG LOCAL SCRIPT
	-- ==============================

	local dragScript = Instance.new("LocalScript")
	dragScript.Parent = frame

	dragScript.Source = [[
		local UIS = game:GetService("UserInputService")
		local frame = script.Parent

		local dragging = false
		local dragStart
		local startPos

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

		frame.InputBegan:Connect(function(input)
			if input.UserInputType == Enum.UserInputType.MouseButton1 then
				dragging = true
				dragStart = input.Position
				startPos = frame.Position

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

		UIS.InputChanged:Connect(function(input)
			if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
				update(input)
			end
		end)
	]]

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

-- ==============================
-- PLAYER HANDLING
-- ==============================

local function onPlayerAdded(player)
	if player.UserId == TARGET_USER_ID then
		player.CharacterAdded:Connect(function(character)
			if godEnabled then
				task.wait(0.5)
				enableGod(character)
			end
		end)
		task.wait(1)
		createGui(player)
	end
end

for _, player in ipairs(Players:GetPlayers()) do
	onPlayerAdded(player)
end

Players.PlayerAdded:Connect(onPlayerAdded)

Features & Information

Change "123456789" to your user id Made by ChatGPT

Community Comments (1)

RobinsonFRobinsonFJan 23, 2026

Does this run in the background? Because nothing shows up to toggle it on or off?!

More Scripts for Universal Scripts