local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local Settings = { Enabled = true, MaxSpeed = 24, Acceleration = 26, Friction = 60, Keybinds = { Toggle = Enum.KeyCode.T, Hide = Enum.KeyCode.H, Remove = Enum.KeyCode.R, }, } local character, humanoid, hrp local currentVelocity = Vector3.new(0,0,0) local inputState = { forward = false, backward = false, left = false, right = false, gamepadVector = Vector2.new(0,0), } local guiVisible = true local running = true local isDead = false local screenGui = Instance.new("ScreenGui") screenGui.Name = "TpwalkGui" screenGui.ResetOnSpawn = false screenGui.Parent = playerGui local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 220, 0, 84) frame.Position = UDim2.new(0, 20, 0, 20) frame.BackgroundColor3 = Color3.new(0, 0, 0) frame.BackgroundTransparency = 0.5 frame.BorderSizePixel = 0 frame.Parent = screenGui local function makeLabel(y, size) local lbl = Instance.new("TextLabel") lbl.Size = UDim2.new(1, -12, 0, 20) lbl.Position = UDim2.new(0, 6, 0, y) lbl.BackgroundTransparency = 1 lbl.TextColor3 = Color3.fromRGB(0, 255, 0) lbl.TextSize = size lbl.TextXAlignment = Enum.TextXAlignment.Left lbl.Parent = frame local ok = pcall(function() lbl.Font = Enum.Font.Code end) if not ok then lbl.Font = Enum.Font.SourceSans end lbl.TextStrokeTransparency = 0.6 lbl.TextStrokeColor3 = Color3.fromRGB(0, 120, 0) return lbl end local title = makeLabel(4, 18) title.Text = "Tpwalk" local statusLabel = Instance.new("TextButton") statusLabel.Size = UDim2.new(1, -12, 0, 20) statusLabel.Position = UDim2.new(0, 6, 0, 32) statusLabel.BackgroundTransparency = 1 statusLabel.TextColor3 = Color3.fromRGB(0, 255, 0) statusLabel.TextSize = 14 statusLabel.TextXAlignment = Enum.TextXAlignment.Left statusLabel.Parent = frame local ok = pcall(function() statusLabel.Font = Enum.Font.Code end) if not ok then statusLabel.Font = Enum.Font.SourceSans end statusLabel.TextStrokeTransparency = 0.6 statusLabel.TextStrokeColor3 = Color3.fromRGB(0, 120, 0) statusLabel.BorderSizePixel = 0 statusLabel.AutoButtonColor = false statusLabel.Activated:Connect(function() Settings.Enabled = not Settings.Enabled if not Settings.Enabled then currentVelocity = Vector3.new(0,0,0) end updateGui() end) local speedLabel = makeLabel(52, 14) local function updateGui() statusLabel.Text = "Status: " .. (Settings.Enabled and "ON" or "OFF") if isDead or not Settings.Enabled then speedLabel.Text = "Speed: 0.00" else speedLabel.Text = string.format("Speed: %.2f", currentVelocity.Magnitude) end frame.Visible = guiVisible end local keyMap = { [Enum.KeyCode.W] = "forward", [Enum.KeyCode.S] = "backward", [Enum.KeyCode.A] = "left", [Enum.KeyCode.D] = "right", [Enum.KeyCode.Up] = "forward", [Enum.KeyCode.Down] = "backward", [Enum.KeyCode.Left] = "left", [Enum.KeyCode.Right] = "right", } UserInputService.InputBegan:Connect(function(inp, processed) if processed then return end if inp.UserInputType == Enum.UserInputType.Keyboard then local dir = keyMap[inp.KeyCode] if dir then inputState[dir] = true end if inp.KeyCode == Settings.Keybinds.Toggle then Settings.Enabled = not Settings.Enabled if not Settings.Enabled then currentVelocity = Vector3.new(0,0,0) end updateGui() elseif inp.KeyCode == Settings.Keybinds.Hide then guiVisible = not guiVisible updateGui() elseif inp.KeyCode == Settings.Keybinds.Remove then running = false screenGui:Destroy() end end end) UserInputService.InputEnded:Connect(function(inp, processed) if processed then return end if inp.UserInputType == Enum.UserInputType.Keyboard then local dir = keyMap[inp.KeyCode] if dir then inputState[dir] = false end end end) UserInputService.InputChanged:Connect(function(inp, processed) if inp.UserInputType == Enum.UserInputType.Gamepad1 and inp.KeyCode == Enum.KeyCode.Thumbstick1 then local pos = inp.Position inputState.gamepadVector = Vector2.new(pos.X, -pos.Y) end end) local function fallbackInputVector2() local x, z = 0, 0 if inputState.forward then z = z + 1 end if inputState.backward then z = z - 1 end if inputState.left then x = x - 1 end if inputState.right then x = x + 1 end local kbVec = Vector2.new(x, z) if kbVec.Magnitude > 0 then kbVec = kbVec.Unit * math.clamp(kbVec.Magnitude, 0, 1) end local gpVec = inputState.gamepadVector local combined = gpVec + kbVec if combined.Magnitude > 1 then combined = combined.Unit end return combined end local function moveDirToCamSpace(v3) local cam = workspace.CurrentCamera if not cam then return Vector2.new(v3.X, v3.Z) end local forward = Vector3.new(cam.CFrame.LookVector.X, 0, cam.CFrame.LookVector.Z) if forward.Magnitude == 0 then forward = Vector3.new(0,0,-1) end forward = forward.Unit local right = Vector3.new(cam.CFrame.RightVector.X, 0, cam.CFrame.RightVector.Z) if right.Magnitude == 0 then right = Vector3.new(1,0,0) end right = right.Unit local x = v3:Dot(right) local y = v3:Dot(forward) return Vector2.new(x, y) end local function setupCharacter(char) character = char humanoid = char:FindFirstChildOfClass("Humanoid") hrp = char:FindFirstChild("HumanoidRootPart") isDead = false currentVelocity = Vector3.new(0,0,0) updateGui() if humanoid then humanoid.Died:Connect(function() isDead = true currentVelocity = Vector3.new(0,0,0) updateGui() end) end end player.CharacterAdded:Connect(function(char) char:WaitForChild("Humanoid") char:WaitForChild("HumanoidRootPart") setupCharacter(char) end) if player.Character then player.Character:WaitForChild("Humanoid") player.Character:WaitForChild("HumanoidRootPart") setupCharacter(player.Character) end RunService.Heartbeat:Connect(function(dt) if not running then return end if not Settings.Enabled then updateGui() return end if isDead then updateGui() return end if not humanoid or humanoid.Health <= 0 then isDead = true currentVelocity = Vector3.new(0,0,0) updateGui() return end if not hrp then updateGui() return end if dt <= 0 then updateGui() return end local desiredVel = Vector3.new(0,0,0) if humanoid.MoveDirection and humanoid.MoveDirection.Magnitude > 0.001 then local dir2 = moveDirToCamSpace(humanoid.MoveDirection) local cam = workspace.CurrentCamera local forward = Vector3.new(cam.CFrame.LookVector.X, 0, cam.CFrame.LookVector.Z) forward = forward.Unit local right = Vector3.new(cam.CFrame.RightVector.X, 0, cam.CFrame.RightVector.Z).Unit local worldDir = right * dir2.X + forward * dir2.Y if worldDir.Magnitude > 0 then desiredVel = worldDir.Unit * Settings.MaxSpeed end else local in2 = fallbackInputVector2() if in2.Magnitude > 0 then local cam = workspace.CurrentCamera local forward = Vector3.new(cam.CFrame.LookVector.X, 0, cam.CFrame.LookVector.Z) if forward.Magnitude == 0 then forward = Vector3.new(0,0,-1) end forward = forward.Unit local right = Vector3.new(cam.CFrame.RightVector.X, 0, cam.CFrame.RightVector.Z).Unit local worldDir = right * in2.X + forward * in2.Y if worldDir.Magnitude > 0 then desiredVel = worldDir.Unit * Settings.MaxSpeed end end end local flat = Vector3.new(currentVelocity.X, 0, currentVelocity.Z) local delta = desiredVel - flat if desiredVel.Magnitude > 0 then local maxD = Settings.Acceleration * dt local dmag = delta.Magnitude if dmag > 0 then flat = flat + delta.Unit * math.min(maxD, dmag) end else local speed = flat.Magnitude local dec = Settings.Friction * dt if speed <= dec then flat = Vector3.new(0,0,0) else flat = flat.Unit * (speed - dec) end end currentVelocity = Vector3.new(flat.X, 0, flat.Z) local disp = currentVelocity * dt if disp.Magnitude > 0 then local oldCf = hrp.CFrame local newPos = oldCf.Position + disp local newCf = CFrame.new(newPos, newPos + oldCf.LookVector) hrp.CFrame = newCf end updateGui() end)