• bit.band problems.
    6 replies, posted
[code] hook.Add("CreateMove","sweg", function(cmd) if (bit.band(cmd:GetButtons(), IN_RIGHT) > 0) then cmd:SetButtons( cmd:GetButtons() , IN_RIGHT end end) ) [/code] I want it so that when you hold right, it spams it as fast as it can, but it just doesnt seem to work.
First of all, you messed up the brackets for SetButtons. Also, do the bit.band like this: [code]bit.band(cmd:GetButtons(), IN_RIGHT) == IN_RIGHT[/code]
So basically [code] hook.Add("CreateMove","sweg", function(cmd) if bit.band(cmd:GetButtons(), IN_RIGHT) == IN_RIGHT then cmd:SetButtons( cmd:GetButtons() , IN_RIGHT ) end end [/code]
[code]hook.Add("CreateMove","sweg", function(cmd) if bit.band(cmd:GetButtons(), IN_RIGHT) == IN_RIGHT then cmd:SetButtons( cmd:GetButtons() , IN_RIGHT ) end end)[/code] You keep messing up the brackets. But this code won't do anything.
Awh, man Can you add me on steam? It'll be quicker than posting in a topic, My name is Dan, i just added you.
Un, no, sorry, I don't help over Steam.
If you're trying to make a strafe run / tap script, changing it in a move hook every tick won't give you the acceleration boost you're looking for.
Sorry, you need to Log In to post a reply to this thread.