Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make typing not trigger hotkeys that I made?

I'm using stuff like KeyCode.F for functions, but if I were to press F while typing it does it.

One of the hotkeys.

dodging = false
uis.InputBegan:connect(function(input)--Dodge
    if input.KeyCode == Enum.KeyCode.E then
      if dodging == false then
           if game.Players.LocalPlayer.Character.Humanoid.Mana.Value < 24 then return end
                   if game.Players.LocalPlayer.Character:FindFirstChild("Humanoid").Mana.Value > 24 then
           game.Players.LocalPlayer.Character:FindFirstChild("Humanoid").Mana.Value = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid").Mana.Value - 25 end
          gg = Instance.new("BodyForce")
          gg.Parent = Player.Character.Torso
          gg.Force = Player.Character.Torso.CFrame.lookVector*-5000
          Player.Character.Humanoid.Jump = true 
          dodging = true
          wait(0.3)
          gg:Destroy()
          wait (0.4)
          dodging = false
		end 
	end
end)

1 answer

dodging = false
uis.InputBegan:connect(function(input, gameProcessedEvent)--Dodge
    if input.KeyCode == Enum.KeyCode.E and gameProcessedEvent == false then
      if dodging == false then
           if game.Players.LocalPlayer.Character.Humanoid.Mana.Value < 24 then return end
                   if game.Players.LocalPlayer.Character:FindFirstChild("Humanoid").Mana.Value > 24 then
           game.Players.LocalPlayer.Character:FindFirstChild("Humanoid").Mana.Value = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid").Mana.Value - 25 end
          gg = Instance.new("BodyForce")
          gg.Parent = Player.Character.Torso
          gg.Force = Player.Character.Torso.CFrame.lookVector*-5000
          Player.Character.Humanoid.Jump = true 
          dodging = true
          wait(0.3)
          gg:Destroy()
          wait (0.4)
          dodging = false
        end 
    end
end)

When a key is pressed while typing, or pressing a button or something like that then gameProcessedEvent will be true, if not then it's false

(I only edited lines 2 and 3, added ", gameProcessedEvent" on line 2, and "and gameProcessedEvent == false" on the 3rd line.

4 comments

0

How do I use that to fix the problem?

0

Can you edit your question and actually include some code so I can see how to fix your problem

0

Done

0

Updated answer

This discussion is preserved as it was. New answers, comments, and votes are closed.