I need help with key tap script

Sorry for posting so much, but please help me. Im trying to make it so when someone equips a skill for example q or e, then they have to press the letter e or for on mobile tap the letter e, if they choose e. Heres a video, In the video i clicked q but only the keycode e works


Heres the script

UIS.InputBegan:Connect(function(input,isTyping)
	if script.Parent.Values.Equipped.Value == true then
		if isTyping then
			return
				elseif input.KeyCode == Enum.KeyCode.E then
			if debounce == false then

				debounce = true
				detroit:FireServer()
			end
		end
	end
end)
local keyWordTable = {
  ["AttackKey"] = Enum.KeyCode.E -- set this to your default key
}

E.MouseButton1Click:Connect(function()
  keyWordTable["AttackKey"] = Enum.KeyCode.E
end)
Q.MouseButton1Click:Connect(function()
  keyWordTable["AttackKey"] = Enum.KeyCode.Q
end)

then change this

elseif input.KeyCode == Enum.KeyCode.E then

to

elseif input.KeyCode == keyWordTable["AttackKey"] then

Hopefully this helps

YES, thank you so much!

1 Like