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?
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
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
@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 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