So i want to know how i can end whatever the player is typing and how to know when the player typed something?
To know when the player chatted, use Player.Chatted event.
You would have to modify the original chat if you want a pre-chat bubble to pop up before they enter the chat message. If you want a simpler way, use UserInputService to detect if they click / and toggle a … chat box above the character, make it toggle.
If you want to detect when a player does chat, use player.Chatted
An easy way would be to use the 2nd parameter of InputBegan
game:GetService'UserInputService'.InputBegan:Connect(function(Input, Typing)
if Typing then
print'Typing in a textbox'
end
end)
“Typing” is a bool that tells you if the user is focused on a text container (Typing = true if input inside a text container)
The Lua Chat System can implement custom states which could be useful for this. It’s actually how they implement whisper chat internally, so you could take a peek at that code for inspiration.
You should Ctrl+F for “In Progress Commands” on that page since I can’t really link that section for some reason.
This is a bit misleading as the second parameter to InputBegan is a boolean called gameProcessedEvent which indicates if the input was handled in some way already (particularly, ContextActionService). Whether it was your game binding R to reload a gun or something else. There’s no way to know for sure with this approach.
The best way for OP to manipulate the behavior of the Lua Chat System is to add their own server/client modules to it, or fork it entirely (not recommended).