So basically I'm willing to make a basic key detection event.
I've been using the InputBegan
event fromUserInputService
, yet this is the issues :
" This event will always fire regardless of game state "
The scripts detects the keys pressed even when a player is typing, which is an issue. Do you know a way to disable the event while the player is typing?
( I'm not using KeyDown event for reasons )
Here is a fix :P
local UIS = game:GetService'UserInputService' UIS.InputBegan:connect(function(Input,gameProcessedEvent) if Input.UserInputType == Enum.UserInputType.Keyboard and not gameProcessedEvent then if Input.KeyCode == Enum.KeyCode.W then -- Change W to the actual key being pressed -- Stuff end end end
gameProcessedEvent checks if the game processed the event which would mean they chatted.