HelpAction Spam

Posts 1–3 of 3 · Page 1 of 1
Action Spam
So, I used to be a HL2 speedrunner, one of the big tricks in the run was wallclimbing, which is done by spamming +use while holding an item.



I wanted to do something similar in GMod, but I have not a clue about how to code lua.
Essentially what I want is to make a new action (like +usespam etc.) that spams +use as quickly as possible. ( I think it would need to do it every other tick, but I may be wrong).
I'd highly prefer it be an action instead of toggling.

Hopefully I can learn a little bit from your guys' code,
Cheers.
Code:
local function use_spam( cmd )
	if ( !cmd:CommandNumber( ) ) then
		return
	end
	
	if ( cmd:KeyDown( IN_ALT1 ) ) then
		if ( cmd:CommandNumber( ) % 2 ) then 
			cmd:SetButtons( bit.bor( cmd:GetButtons(), IN_USE ) )
		end
	end
end

hook.Add( "CreateMove", "", use_spam )
may work or not

bind a key to +alt1
Doesn't work, not sure why.
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us