KeyDown is not working correctly, how do i fix?
Asked by
8 years ago Edited 8 years ago
Here is what I got.
01 | local HitAKey = game.Players.LocalPlayer:GetMouse().KeyDown |
02 | local Name = game.Players.LocalPlayer.Name |
04 | HitAKey:connect( function (key) |
05 | if key = = 'e' or 'E' then |
06 | print (Name.. " has pressed E!" ) |
07 | elseif key = = 'q' or 'Q' then |
08 | print (Name.. " has pressed Q!" ) |
But when I press any keyboard button, like A, it prints "Player1 has pressed E!" But it still prints that if I press W, A, S, D keys again!