Auto Bhop Script?

Hey guys! I have just recently made a new deathrun server. Since I am using blackvoid version for a certain addon it dosent include auto bhop. Can someone help me and/or make me a script for auto bhop on my server? Thanks!

function CanHop( ent )

	if ( !ent:KeyDown( IN_JUMP ) ) then return false end
	if ( LocalPlayer():IsOnGround() ) then return false end
	if ( LocalPlayer():InVehicle() ) then return false end
	if ( LocalPlayer():GetMoveType() == MOVETYPE_NOCLIP ) then return false end
	if ( LocalPlayer():WaterLevel() >= 2 ) then return false end

	return true


function Bhop( ent )

	if ( CanHop( ent ) ) then 

		ent:SetButtons( ent:GetButtons() - IN_JUMP )

hook.Add( "CreateMove", "adsadas", Bhop )

Where should I put that file?

I editted my first post, and in autorun/client/ yeah?

Beat me to it :frowning:


if CLIENT then
	CreateClientConVar( "deathrun_autojump", 1, true, true )
local band =
local bor = bit.bor
local bnot = bit.bnot
hook.Add("SetupMove", "DR_AutoJump", function(ply, uc)
	if CLIENT and GetConVarNumber( "deathrun_autojump" ) ~= 1 then return end
	if SERVER and ply:GetInfoNum( "deathrun_autojump", 1 ) ~= 1 then return end
	if ply:Alive() and ply:GetMoveType() == MOVETYPE_WALK and not ply:InVehicle() and ply:WaterLevel() <= 1 and band(uc:GetButtons(), IN_JUMP) == IN_JUMP then		
		if ply:IsOnGround() then
			uc:SetButtons( bor( uc:GetButtons(), IN_JUMP) )
			uc:SetButtons( band( uc:GetButtons(), bnot(IN_JUMP)) )

Thanks guys! Appreciate it!