local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local Workspace = game:GetService("Workspace") local LocalPlayer = Players.LocalPlayer local Camera = Workspace.CurrentCamera local SETTINGS = { Speed = 18, --dont change it if want just good bhop Smoothness = 0.2, RayDistance = -4 } local function GetMoveDirection() local Direction = Vector3.zero local LookVector = Camera.CFrame.LookVector local RightVector = Camera.CFrame.RightVector if UserInputService:IsKeyDown(Enum.KeyCode.W) then Direction += LookVector end if UserInputService:IsKeyDown(Enum.KeyCode.S) then Direction -= LookVector end if UserInputService:IsKeyDown(Enum.KeyCode.A) then Direction -= RightVector end if UserInputService:IsKeyDown(Enum.KeyCode.D) then Direction += RightVector end return Vector3.new(Direction.X, 0, Direction.Z).Unit end RunService.Heartbeat:Connect(function() local Character = LocalPlayer.Character if not Character then return end local RootPart = Character:FindFirstChild("HumanoidRootPart") local Humanoid = Character:FindFirstChild("Humanoid") if not RootPart or not Humanoid then return end if UserInputService:IsKeyDown(Enum.KeyCode.Space) then local RayParams = RaycastParams.new() RayParams.FilterDescendantsInstances = {Character} RayParams.FilterType = Enum.RaycastFilterType.Exclude local GroundCheck = Workspace:Raycast(RootPart.Position, Vector3.new(0, SETTINGS.RayDistance, 0), RayParams) if GroundCheck then Humanoid.Jump = true end end local Direction = Vector3.zero local Success, Result = pcall(function() return GetMoveDirection() end) if Success and Result.Magnitude > 0 then Direction = Result * SETTINGS.Speed local Velocity = RootPart.AssemblyLinearVelocity local NewX = Velocity.X + (Direction.X - Velocity.X) * SETTINGS.Smoothness local NewZ = Velocity.Z + (Direction.Z - Velocity.Z) * SETTINGS.Smoothness RootPart.AssemblyLinearVelocity = Vector3.new(NewX, Velocity.Y, NewZ) end end)