First of all, you cannot use UI elements in a server script. Second, you shouldn’t be using StarterGui. Third, you can just use player.UserId to get the user ID. What you can do is when the focus is lost you can pass the text in the remote event, then access that argument you sent to get the user ID for another player. And also I don’t know what you are doing with the animation inserting. That’s not the way you should do it.
-- Local Script
script.Parent.FocusLost:Connect(function()
game.ReplicatedStorage.CopyCharDesc:FireServer(script.Parent.Text)
end)
-- Server Script
game.ReplicatedStorage.CopyCharDesc.OnServerEvent:Connect(function(player, targetPlayerName)
local char = game.Workspace[1]
local userid = game.Players:GetUserIdFromNameAsync(targetPlayerName)
local desc = game.Players:GetHumanoidDescriptionFromUserId(userid)
local animId = desc.IdleAnimation
local animation = Instance.new("Animation")
animation.AnimationId = animId
char.Humanoid:ApplyDescription(desc)
local track = char.Humanoid:LoadAnimation(animation)
track:Play()
end)