Bhop
Key RequiredUniversal

Bhop

Universal ScriptFp2SwitchEmDownFp2SwitchEmDown 1.6K views 658 executesUpdated Mar 4, 2026
5.0/ 5(2 votes)
20100% Positive
Lua Script•228 lines (6631 chars)
-- Config
local FirstPersonLock = true
local DisableAnimations = true
local MaxSpeed = 250
local GroundMaxSpeed = 16
local AirMaxSpeed = 2 -- keep low
local GroundAcceleration = 50
local AirAcceleration = 800
local Friction = 5
local AirControl = 0
local JumpPower = 50
local Gravity = 196.2

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UIS = game:GetService("UserInputService")

local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
local character, humanoid, rootPart
local velocity = Vector3.new(0, 0, 0)
local isGrounded = false
local jumpHeld, wishJump = false, false
local moveForward, moveRight = 0, 0

local function flat(v)
	return Vector3.new(v.X, 0, v.Z)
end

-- source engine logic
local function accelerate(vel, wishDir, wishSpeed, accel, dt)
	local addSpeed = wishSpeed - vel:Dot(wishDir)
	if addSpeed <= 0 then return vel end
	local accelSpeed = math.min(accel * wishSpeed * dt, addSpeed)
	return vel + wishDir * accelSpeed
end

local function applyFriction(vel, dt)
	local speed = flat(vel).Magnitude
	if speed < 0.1 then return Vector3.new(0, vel.Y, 0) end
	local drop = math.max(speed, GroundMaxSpeed) * Friction * dt
	local scale = math.max(speed - drop, 0) / speed
	return Vector3.new(vel.X * scale, vel.Y, vel.Z * scale)
end

local function applyAirControl(vel, wishDir, dt)
	if AirControl == 0 or moveRight ~= 0 then return vel end
	local fv = flat(vel)
	local speed = fv.Magnitude
	if speed < 0.1 then return vel end
	local dot = fv.Unit:Dot(wishDir)
	if dot <= 0 then return vel end
	local k = AirControl * dot * dot * dt * 32
	local adj = (fv * (1 - k) + wishDir * (speed * k)).Unit * speed
	return Vector3.new(adj.X, vel.Y, adj.Z)
end

-- hop sounds place sounds in here if you want.
local hopSounds = {
}
local hopIndex = 1
local hopLoaded = false
local sound1, sound2

task.spawn(function()
	if #hopSounds < 2 then return end
	local ok, err = pcall(function()
		writefile("bhop1.mp3", game:HttpGet(hopSounds[1]))
		writefile("bhop2.mp3", game:HttpGet(hopSounds[2]))
	end)
	if not ok then warn("couldnt download hop sounds: " .. tostring(err)) return end
	sound1 = Instance.new("Sound")
	sound1.SoundId = getcustomasset("bhop1.mp3")
	sound1.Volume = 0.35
	sound1.Parent = workspace
	sound2 = Instance.new("Sound")
	sound2.SoundId = getcustomasset("bhop2.mp3")
	sound2.Volume = 0.35
	sound2.Parent = workspace

	hopLoaded = true
end)

local function playHopSound()
	if not hopLoaded then return end
	if hopIndex == 1 then
		sound1:Play()
	else
		sound2:Play()
	end
	hopIndex = hopIndex == 1 and 2 or 1
end

local function nukeAnimations()
	if not DisableAnimations then return end
	local animate = character:FindFirstChild("Animate")
	if animate then animate:Destroy() end
	for _, track in humanoid:GetPlayingAnimationTracks() do
		track:Stop(0)
	end
	local animator = humanoid:FindFirstChildOfClass("Animator")
	if animator then animator:Destroy() end
end

-- input
UIS.InputBegan:Connect(function(input, gp)
	local kc = input.KeyCode
	if kc == Enum.KeyCode.Space then jumpHeld = true return end
	if gp then return end
	if kc == Enum.KeyCode.W then moveForward = 1
	elseif kc == Enum.KeyCode.S then moveForward = -1
	elseif kc == Enum.KeyCode.A then moveRight = -1
	elseif kc == Enum.KeyCode.D then moveRight = 1 end
end)

UIS.InputEnded:Connect(function(input)
	local kc = input.KeyCode
	if kc == Enum.KeyCode.W and moveForward == 1 then moveForward = 0
	elseif kc == Enum.KeyCode.S and moveForward == -1 then moveForward = 0
	elseif kc == Enum.KeyCode.A and moveRight == -1 then moveRight = 0
	elseif kc == Enum.KeyCode.D and moveRight == 1 then moveRight = 0
	elseif kc == Enum.KeyCode.Space then jumpHeld = false end
end)

-- ground check
local rayParams = RaycastParams.new()
rayParams.FilterType = Enum.RaycastFilterType.Exclude

local function grounded()
	if not rootPart then return false end
	rayParams.FilterDescendantsInstances = {character}
	return workspace:Raycast(rootPart.Position, Vector3.new(0, -3.5, 0), rayParams) ~= nil
end

local function getWishDir()
	if moveForward == 0 and moveRight == 0 then return Vector3.zero end
	local cf = camera.CFrame
	local dir = flat(cf.LookVector).Unit * moveForward + flat(cf.RightVector).Unit * moveRight
	return dir.Magnitude > 0 and dir.Unit or Vector3.zero
end

local function physicsStep(dt)
	if not rootPart or not humanoid or humanoid.Health <= 0 then return end
	humanoid.WalkSpeed = 0
	humanoid.JumpPower = 0
	humanoid.JumpHeight = 0

	isGrounded = grounded()
	velocity = Vector3.new(velocity.X, rootPart.AssemblyLinearVelocity.Y, velocity.Z)

	wishJump = jumpHeld

	if isGrounded and wishJump then
		velocity = Vector3.new(velocity.X, JumpPower, velocity.Z)
		isGrounded = false
		playHopSound()
	end

	local wishDir = getWishDir()

	if isGrounded then
		velocity = applyFriction(velocity, dt)
		if wishDir.Magnitude > 0 then
			velocity = accelerate(velocity, wishDir, GroundMaxSpeed, GroundAcceleration, dt)
		end
	elseif wishDir.Magnitude > 0 then
		velocity = accelerate(velocity, wishDir, AirMaxSpeed, AirAcceleration, dt)
		velocity = applyAirControl(velocity, wishDir, dt)
	end

	-- speed cap
	local fv = flat(velocity)
	if fv.Magnitude > MaxSpeed then
		fv = fv.Unit * MaxSpeed
		velocity = Vector3.new(fv.X, velocity.Y, fv.Z)
	end

	rootPart.AssemblyLinearVelocity = velocity

	-- face camera direction
	local look = flat(camera.CFrame.LookVector)
	if look.Magnitude > 0.01 then
		rootPart.CFrame = CFrame.new(rootPart.Position, rootPart.Position + look)
	end
end

-- character 
local conn
local function setup(char)
	character = char
	humanoid = char:WaitForChild("Humanoid")
	rootPart = char:WaitForChild("HumanoidRootPart")
	velocity = Vector3.zero
	isGrounded = false
	jumpHeld, wishJump = false, false
	moveForward, moveRight = 0, 0

	task.wait()
	workspace.Gravity = Gravity

	if FirstPersonLock then
		player.CameraMode = Enum.CameraMode.LockFirstPerson
	else
		player.CameraMode = Enum.CameraMode.Classic
	end

	humanoid.WalkSpeed = 0
	humanoid.JumpPower = 0
	humanoid.JumpHeight = 0
	humanoid.AutoRotate = false
	humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
	nukeAnimations()

	if conn then conn:Disconnect() end
	conn = RunService.RenderStepped:Connect(physicsStep)

	humanoid.StateChanged:Connect(function()
		humanoid.WalkSpeed = 0
		humanoid.JumpPower = 0
		humanoid.JumpHeight = 0
		humanoid.AutoRotate = false
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
	end)
end

if player.Character then setup(player.Character) end
player.CharacterAdded:Connect(setup)
print("Fuck You Bitch" ... " sike im joking")

Features & Information

ONLY USE THIS IN GAMES WITH NO ANTI CHEAT!! Counter strike type bhopping, Change configuration at top of script if you want.
#universal#bhop#op#movement#fun

Community Comments (1)

yafesyafesJun 19, 2026

noting happens bro

More Scripts for Universal Scripts