Created
December 22, 2025 22:33
-
-
Save ryzen885/b1f73fe516907bd86a97c248f905ed1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --================ SERVICES ================= | |
| local Players = game:GetService("Players") | |
| local ReplicatedStorage = game:GetService("ReplicatedStorage") | |
| local RunService = game:GetService("RunService") | |
| local player = Players.LocalPlayer | |
| local toggleRemote = ReplicatedStorage:WaitForChild("ToggleAutoParry") | |
| --================ GUI ================= | |
| local gui = Instance.new("ScreenGui") | |
| gui.Name = "AutoParryGUI" | |
| gui.ResetOnSpawn = false | |
| gui.Parent = player:WaitForChild("PlayerGui") | |
| -- Main toggle button | |
| local button = Instance.new("TextButton") | |
| button.Size = UDim2.fromScale(0.28, 0.08) | |
| button.Position = UDim2.fromScale(0.36, 0.86) | |
| button.BackgroundColor3 = Color3.fromRGB(160, 0, 0) | |
| button.TextColor3 = Color3.new(1,1,1) | |
| button.TextScaled = true | |
| button.BorderSizePixel = 0 | |
| button.Text = "AUTO PARRY: OFF" | |
| button.Parent = gui | |
| -- Optional: draggable GUI | |
| local dragging | |
| local dragInput | |
| local dragStart | |
| local startPos | |
| button.InputBegan:Connect(function(input) | |
| if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true | |
| dragStart = input.Position | |
| startPos = button.Position | |
| input.Changed:Connect(function() | |
| if input.UserInputState == Enum.UserInputState.End then | |
| dragging = false | |
| end | |
| end) | |
| end | |
| end) | |
| button.InputChanged:Connect(function(input) | |
| if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then | |
| dragInput = input | |
| end | |
| end) | |
| RunService.RenderStepped:Connect(function() | |
| if dragging and dragInput then | |
| local delta = dragInput.Position - dragStart | |
| button.Position = UDim2.new( | |
| startPos.X.Scale, | |
| startPos.X.Offset + delta.X, | |
| startPos.Y.Scale, | |
| startPos.Y.Offset + delta.Y | |
| ) | |
| end | |
| end) | |
| --================ TOGGLE ================= | |
| local enabled = false | |
| button.MouseButton1Click:Connect(function() | |
| enabled = not enabled | |
| toggleRemote:FireServer(enabled) | |
| button.Text = enabled and "AUTO PARRY: ON" or "AUTO PARRY: OFF" | |
| button.BackgroundColor3 = | |
| enabled and Color3.fromRGB(0, 170, 0) or Color3.fromRGB(160, 0, 0) | |
| end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment