Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- ScreenGui.Name = "GodModeGUI"
- local Frame = Instance.new("Frame")
- Frame.Parent = ScreenGui
- Frame.Size = UDim2.new(0, 200, 0, 100)
- Frame.Position = UDim2.new(0.5, -100, 0.1, 0)
- Frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- Frame.Active = true
- Frame.Draggable = true --
- local Title = Instance.new("TextLabel")
- Title.Parent = Frame
- Title.Size = UDim2.new(1, 0, 0.3, 0)
- Title.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- Title.TextColor3 = Color3.fromRGB(255, 255, 255)
- Title.Text = "God Mode"
- Title.Font = Enum.Font.SourceSansBold
- Title.TextSize = 20
- local ToggleButton = Instance.new("TextButton")
- ToggleButton.Parent = Frame
- ToggleButton.Size = UDim2.new(0.8, 0, 0.4, 0)
- ToggleButton.Position = UDim2.new(0.1, 0, 0.5, 0)
- ToggleButton.BackgroundColor3 = Color3.fromRGB(100, 100, 255)
- ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- ToggleButton.Text = "ON"
- ToggleButton.Font = Enum.Font.SourceSansBold
- ToggleButton.TextSize = 20
- --
- local godModeEnabled = true
- ToggleButton.MouseButton1Click:Connect(function()
- godModeEnabled = not godModeEnabled
- if godModeEnabled then
- ToggleButton.Text = "ON"
- ToggleButton.BackgroundColor3 = Color3.fromRGB(100, 100, 255)
- else
- ToggleButton.Text = "OFF"
- ToggleButton.BackgroundColor3 = Color3.fromRGB(255, 100, 100)
- end
- end)
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local function monitorHealth()
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if humanoid then
- humanoid.HealthChanged:Connect(function()
- if godModeEnabled and humanoid.Health < humanoid.MaxHealth then
- humanoid.Health = humanoid.MaxHealth
- end
- end)
- end
- end
- character.ChildAdded:Connect(function(child)
- if child:IsA("Humanoid") then
- monitorHealth()
- end
- end)
- monitorHealth()
Advertisement
Add Comment
Please, Sign In to add comment