• two keypress activates ability, how to disable keypress/activation after?
    1 replies, posted
Code: cool = 0 hook.Add("KeyPress", "speedability", function(ply, key)     if key != IN_USE and !ply:KeyDown(IN_SPEED) then return end     if key == IN_USE and ply:KeyDown(IN_SPEED) and ply:Team() == TEAM_LS and cool == 0 then                  timer.Simple(0.1, function()         ply:SetWalkSpeed(640)         ply:SetRunSpeed(960)         cool = 1 end) end                  if cool == 1 then         timer.Create("resetAbility"..ply:EntIndex(), 8, 1, function()                          ply:SetWalkSpeed(160)             ply:SetRunSpeed(240)             cool = 0             end) end          end) I know this isn't correct but I'm having a brainfart - how do I stop the function from running if the player presses Shift+E again - so that they can't infinitely trigger the speed ability?
hook.Remove("KeyPress", "speedability") after triggering it ?
Sorry, you need to Log In to post a reply to this thread.