I’m making a custom chat gui and trying to get the player who entered into a textbox’s name.
Here’s my code, if it helps.
script.Parent.ChatBox.FocusLost:Connect(function(enterPressed)
if enterPressed then
for _, player in pairs(game:GetService("Players"):GetPlayers()) do
local clone = player.PlayerGui.Chat.ChatFrame1.ScrollingFrame.Template:Clone()
clone.Visible = true
clone.Text = player.PlayerGui.Chat.ChatFrame1.ChatBox.Text
clone.Parent = player.PlayerGui.Chat.ChatFrame1.ScrollingFrame
script.Parent.ChatBox.Text = ""
end
end
end)
(im using Vanilla 3 icons, but its simple to understand what everything is)