I’m trying to load a character onto an NPC using usernames. For example, if you type in “Shedletsky” the NPC will load their avatar. However, ApplyDescription only works with normal scripts, not local. Is there an alternative to loading characters locally? Or, atleast achieve the same effect with different lines of code?
local char = game.Workspace.character
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Parent.confirm:Play()
local username = script.Parent.Parent.Text
print(username)
local userid = game.Players:GetUserIdFromNameAsync(username)
print(userid)
local humdesc = game.Players:GetHumanoidDescriptionFromUserId(userid)
char.Humanoid:ApplyDescription(humdesc)
end)