Detecting the player who entered in a textbox

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)

image_2024-05-07_180356140
(im using Vanilla 3 icons, but its simple to understand what everything is)