local UserInputService = game:GetService("UserInputService") local VirtualInputManager = game:GetService("VirtualInputManager") local RunService = game:GetService("RunService") local Players = game:GetService("Players") local lp = Players.LocalPlayer local isEnabled = false local function AutoM1() VirtualInputManager:SendMouseButtonEvent(0, 0, 0, true, game, 0) task.wait(0.01) VirtualInputManager:SendMouseButtonEvent(0, 0, 0, false, game, 0) end local function WatchForSwap() local char = lp.Character if not char or not char:FindFirstChild("HumanoidRootPart") then return end local hrp = char.HumanoidRootPart local timeElapsed = 0 local lastPos = hrp.Position local lastLook = hrp.CFrame.LookVector local connection connection = RunService.Heartbeat:Connect(function(dt) timeElapsed = timeElapsed + dt local currentPos = hrp.Position local currentLook = hrp.CFrame.LookVector local distanceMoved = (currentPos - lastPos).Magnitude local rotationChange = (currentLook - lastLook).Magnitude if distanceMoved > 1.5 or rotationChange > 0.5 then connection:Disconnect() task.wait(0.04) AutoM1() return end if timeElapsed >= 0.5 then connection:Disconnect() task.wait(0.01) AutoM1() return end lastPos = currentPos lastLook = currentLook end) end local sgui = Instance.new("ScreenGui", game.CoreGui) local btn = Instance.new("TextButton", sgui) btn.Size = UDim2.new(0, 180, 0, 45) btn.Position = UDim2.new(0.5, -90, 0.15, 0) btn.Text = "PERFECT SWAP: OFF" btn.BackgroundColor3 = Color3.fromRGB(30, 30, 30) btn.TextColor3 = Color3.fromRGB(255, 255, 255) btn.Font = Enum.Font.GothamBold btn.TextSize = 14 btn.Draggable = true Instance.new("UICorner", btn) btn.MouseButton1Click:Connect(function() isEnabled = not isEnabled btn.Text = isEnabled and "PERFECT SWAP: ON" or "PERFECT SWAP: OFF" btn.BackgroundColor3 = isEnabled and Color3.fromRGB(0, 180, 0) or Color3.fromRGB(180, 0, 0) end) UserInputService.InputBegan:Connect(function(input, processed) if processed then return end if isEnabled and input.KeyCode == Enum.KeyCode.R then WatchForSwap() end end)