I want to use UserInputService, but I need a way to detect if the player is interacting with Guis, including them typing in roblox's chat. I am extreamly stuck with this manner and I have no idea how to do this.
✓ ANSWER ACCEPTED
How to detect player interaction in GUIs?
1 answer
✓ Accepted answer
It mostly depends on what gui element your going to have them interact with. For a button of any type.
local guiElement = script.Parent --This assumes the gui element is the scripts parent
guiElement.MouseButton1Click:Connect(function()
--Do something
end)
--This is a local script
And if you wanted to see when a user sends a message in chat you would use:
game.Players.LocalPlayer.Chatted:Connect(function(chat)
--Do something
end)
--This is also a local script
There isn't any event for when the player starts typing in chat though. So there isn't a 100% reliable way to see when a player is typing in chat without redoing the whole chat gui.
If this answer helped be sure to accept it so we both get some rep :)
1 comment
0
Im pretty sure game.Players.LocalPlayer.Chatted doesnt fire when they are typing.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
You could use UIS.TextBoxFocused and FocusReleased. You also use the gameProcessedEvent parameter in InputBegan. What exactly are you trying to do though?
if you find nothing else, this is the alternative Gui.MouseEnter:Connect(function() end)