I'm trying to add a typing icon above a player when they're typing a message. My problem here is I don't know how to actually detect when a player is typing. Fairly simple question.
I don't want to detect when a player presses the / key because if you click on the chatbox you won't be recognized as typing (nobody does that anyways, but I just want consistency)
this will get you started
this script will clone the script to all the payer. but for reason it doesnt work in game or in studio testing mode with 2 players (same computer)
put this script Named: "Focus" in ReplicatedStorage
script.Parent.Focused:connect(function() print("Player is typing") end) script.Parent.FocusLost:connect(function(enterPressed) if enterPressed then print("Focus was lost because enter was pressed!") end end)
and this Localscript in StarterPlayerScripts
local script = game.ReplicatedStorage.Focus:clone() local player = game.Players.LocalPlayer local chatbar = player.PlayerGui:WaitForChild("Chat").DestroyGuardFrame.Frame.ChatBarParentFrame.Frame.BoxFrame.Frame.ChatBar script.Parent = chatbar
it will clone the Focus script from ReplicatedStorage into the chat box where you type either if you click it or press / and will stop when you press Enter, so good luck, the rest is up to you now.