Hi, so basically I made 2 scripts that would override a dummy’s avatar using GetHumanoidDescriptionFromUserId. I have a RemoteEvent Used for this that fires when you lose focus of the textbox and sends the player’s username through the textbox and converts to userId using GetUserIdFromNameAsync. The problem is that the script checking the textbox for the player’s name is a normal script so it just doesn’t work. But I can’t use a local script since it requires a normal script to use GetHumanoidDescription.
Is there anyway I can use the same variables for both of the scripts, or anything else?
Sorry if I made it confusing, I just don’t know how to explain it that well
LocalScript:
-- PLAYER 1
script.Parent.FocusLost:Connect(function()
game.ReplicatedStorage.CopyCharDesc:FireServer()
end)
Script inside serverscriptservice:
game.ReplicatedStorage.CopyCharDesc.OnServerEvent:Connect(function(player)
local char = game.Workspace[1]
local textbox = game.StarterGui.ScreenGui.Frame.plr1
local userid = game.Players:GetUserIdFromNameAsync(textbox.Text)
local desc = game.Players:GetHumanoidDescriptionFromUserId(userid)
local animId = desc.IdleAnimation
char.Humanoid:ApplyDescription(desc)
local animation = game:GetService("InsertService"):LoadAsset(animId):GetChildren()[1]:GetChildren()[1]:GetChildren()[1]
game:GetService("InsertService"):LoadAsset(animId).Parent = workspace
local track = char.Humanoid:LoadAnimation(animation)
track:Play()
end)