Disabling "Jump Boost" with a lua script

In gamemode/player_class/player_sandbox.lua, you can find this lua code here;


local JUMPING

function PLAYER:StartMove( move )
	
	-- Only apply the jump boost in FinishMove if the player has jumped during this frame
	-- Using a global variable is safe here because nothing else happens between SetupMove and FinishMove
	if bit.band( move:GetButtons(), IN_JUMP ) ~= 0 and bit.band( move:GetOldButtons(), IN_JUMP ) == 0 and self.Player:OnGround() then
		JUMPING = true
	end
	
end

function PLAYER:FinishMove( move )
	
	-- If the player has jumped this frame
	if JUMPING then
		-- Get their orientation
		local forward = move:GetAngles()
		forward.p = 0
		forward = forward:Forward()
		
		-- Compute the speed boost
		
		-- HL2 normally provides a much weaker jump boost when sprinting
		-- For some reason this never applied to GMod, so we won't perform
		-- this check here to preserve the "authentic" feeling
		local speedBoostPerc = ( ( not self.Player:Crouching() ) and 0.5 ) or 0.1
		
		local speedAddition = math.abs( move:GetForwardSpeed() * speedBoostPerc )
		local maxSpeed = move:GetMaxSpeed() * ( 1 + speedBoostPerc )
		local newSpeed = speedAddition + move:GetVelocity():Length2D()
		
		-- Clamp it to make sure they can't bunnyhop to ludicrous speed
		if newSpeed > maxSpeed then
			speedAddition = speedAddition - (newSpeed - maxSpeed)
		end
		
		-- Reverse it if the player is running backwards
		if move:GetForwardSpeed() < 0 then
			speedAddition = -speedAddition
		end
		
		-- Apply the speed boost
		move:SetVelocity(forward * speedAddition + move:GetVelocity())
	end
	
	JUMPING = nil
	
end

Apparently it gives a jump boost whenever you jump forward, which tends to be annoying when playing “seriously”. I tried to make a script to remove it, but I can’t seem to make it work. Can somebody make it, please?

My attempts were this;


function StartMove( )
	
	if bit.band( move:GetButtons(), IN_JUMP ) ~= 0 and bit.band( move:GetOldButtons(), IN_JUMP ) == 0 and self.Player:OnGround() then
		JUMPING = false
	return false
	end
end

Yes, I am trying to disable it via the “lua_openscript” console command.

You do see the pinned post at the top, right?
“THIS ISN’T THE FORUM FOR LUA SCRIPTING HELP”

Create your own player class that inherits from Sandbox’s, but replace the StartMove function. Example: https://github.com/FPtje/DarkRP/blob/master/gamemode/modules/base/sh_playerclass.lua