Hello! I made an event script that changes appearance of npc by username. This is how it looks like:
local event = game:GetService("ReplicatedStorage").RemoteEvent2
local dummy = script.Parent
event.OnServerEvent:Connect(function(player, aa)
local userid = game:GetService("Players"):GetUserIdFromNameAsync(aa)
local info = game:GetService("Players"):GetCharacterAppearanceInfoAsync(userid)
local Dummy = game:GetService("Workspace").Dummy
local username = aa
local bodicolorz = game:GetService("Workspace").Dummy["Body Colors"]
bodicolorz.LeftArmColor = BrickColor.new(info["bodyColors"]["leftArmColorId"])
bodicolorz.RightArmColor = BrickColor.new(info["bodyColors"]["rightArmColorId"])
bodicolorz.LeftLegColor = BrickColor.new(info["bodyColors"]["leftLegColorId"])
bodicolorz.RightLegColor = BrickColor.new(info["bodyColors"]["rightLegColorId"])
bodicolorz.TorsoColor = BrickColor.new(info["bodyColors"]["torsoColorId"])
bodicolorz.HeadColor = BrickColor.new(info["bodyColors"]["headColorId"])
local insertservice = game:GetService("InsertService")
for i = 1,#info["assets"] do
local aaa = insertservice:LoadAsset(info["assets"][i]["id"])
aaa.Parent = Dummy
aaa:GetChildren()[1].Parent = Dummy
aaa:Destroy()
end
end)
But if the client wants to change the npc to another, then on npc will be old accessories. I didn’t find anything about that, so I’m asking for help.