concommand.Add( "+command", dostuff )

I want a function to keep rerunning whenever i have “+command” down, but when the command “-command” is being ran, i want the function to stop running, how would i go by doing this? Specifically this.


function DebugHop( ply )
	if ply:SteamID() == "STEAM_0:1:***" then
		if ply:IsOnGround() then
			RunConsoleCommand( "+jump" )
		else
			RunConsoleCommand( "-jump" )
		end
	end
end
concommand.Add( "+debughop", DebugHop )

I want it to automatically jump off the ground when you land on it, so it autojumps for you, but only when you are holding down a key, specifically a bind.