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.
2 comments
is this a custom gui or the default chat gui?
http://wiki.roblox.com/index.php?title=API:Class/TextBox#Events You can connect to Focused and FocusLost on the chat bar.