Make a Rig Copying Players Looks only for client side

I have a rig on workspace that copy’s the users looks and have them on. Problem is that it’s going to copy everyone’s looks in the game and I was wondering how could I make this run in client side only?


Script:

local bin = script.Parent
local config = bin.Config

local accessories = config.addAccessories
local clothing = config.addCloth
local face = config.addFace
local shape = config.addBodyShape
local color = config.addColor
local t = config.addT

local delayTime = 2

game.Players.PlayerAdded:Connect(function(plr)
wait(delayTime)
local h = plr.Character

if (h:FindFirstChild("Pants") and h:FindFirstChild("Shirt")) and clothing.Value==true then
	h:WaitForChild("Pants"):Clone().Parent = bin
	h:WaitForChild("Shirt"):Clone().Parent = bin
end
for i, v in pairs(plr.Character:GetChildren()) do
	if v:IsA("Accessory") and accessories.Value==true then
		v:Clone().Parent = bin
	elseif v:IsA("BodyColors") and color.Value==true then
		v:Clone().Parent = bin
	elseif v:IsA("ShirtGraphic") and t.Value==true then
		v:Clone().Parent = bin
	end
end

if h.Head:FindFirstChild("face") and face.Value==true then
	bin.Head.face.Texture = h.Head:WaitForChild("face").Texture
end

for i,v in pairs(h.Humanoid:GetChildren()) do
	if (v:IsA("HumanoidDescription") or v:IsA("NumberValue")) and shape.Value==true then
		v:Clone().Parent = bin.Humanoid
	end
end

end)

1 Like

you can run this on a local script placed inside starterplayerscripts then just change the local rig = workspace:WaitForChild(insert name of rig) there, i suggest changing the model name to something a user wont have username of by adding underscore

I did that but nothing had updated the Rig and there were no errors aswell.

@ifqksz We only got the face to change but nothing else from the local area.
Script:

local bin = workspace:WaitForChild(“TheLoadingModel”)
local config = bin.Config

local accessories = config.addAccessories
local clothing = config.addCloth
local face = config.addFace
local shape = config.addBodyShape
local color = config.addColor
local t = config.addT

local delayTime = 9

game.Players.LocalPlayer.CharacterAdded:Connect(function(character)
wait(delayTime)

local h = character

if (h:FindFirstChild("Pants") and h:FindFirstChild("Shirt")) and clothing.Value==true then
    h:WaitForChild("Pants"):Clone().Parent = bin
    h:WaitForChild("Shirt"):Clone().Parent = bin
end

for i, v in pairs(h:GetChildren()) do
    if v:IsA("Accessory") and accessories.Value==true then
        v:Clone().Parent = bin
    elseif v:IsA("BodyColors") and color.Value==true then
        v:Clone().Parent = bin
    elseif v:IsA("ShirtGraphic") and t.Value==true then
        v:Clone().Parent = bin
    end
end

if h.Head:FindFirstChild("face") and face.Value==true then
    bin.Head.face.Texture = h.Head:WaitForChild("face").Texture
end

for i,v in pairs(h.Humanoid:GetChildren()) do
    if (v:IsA("HumanoidDescription") or v:IsA("NumberValue")) and shape.Value==true then
        v:Clone().Parent = bin.Humanoid
    end
end

bin.Name = h.Name

end)

Instead of cloning shirt and pants and etc, maybe you can do this to the rig’s humanoid:

local humDesc = player.Character.Humanoid:FindFirstChild(“HumanoidDescription”) or game.Players:GetHumanoidDescriptionFromUserId(player.UserId)

humanoid:ApplyDescription(humDesc)

then go and remove if the config doesn’t want to have addShirt and stuff before applydescription by changing humdesc properties

1 Like