Adjusting up velocity when jump is pressed

I’m wanting to change a players velocity when the space key is pushed.

I’ve come up with this:


hook.Add( "Think", "upveloc", function( ply, key )
	if ( key == IN_JUMP ) then
		ply:SetVelocity(ply:GetUp() * 9)
	end
end )