Below is my code, I don't want this to trigger when the player is chatting but I do want it to when they hit the key though.
function onKeyPressed(inputObject, gameProcessEvent) if inputObject.KeyCode == Enum.KeyCode.E then print("E")
Hey there, there is a preatty easy solution for that! You can use the context action service in roblox, so it wont trigger when you write in chat.
Here is the link to ContextActionService: https://developer.roblox.com/en-us/api-reference/class/ContextActionService.
I hope I could help you out. If you need any help implementing it into your systeme, make sure to contact me, so I can help you out. Have a nice day, esepek.
Hello @NortonHDD, I realized that although gameProessedEvent is a parameter of your function, you don't actually check if the event is game processed or not.
Try this:
local function onKeyPressed(inputObject, gameProcessEvent) if not (gameProcessEvent) then if inputObject.KeyCode == Enum.KeyCode.E then print("E") end end end
Hope this helps :D