This replicates the 2nd leg 14 times. The 1st leg is duplicated 3 times but the chest is only duplicated once? I am confused of why it is doing this. It is gui activated so that might have something to do with it but I added a denounce and still the same happens. This causes lag with big models since it can duplicate many times over. Any idea? - thx
local g = game.ReplicatedStorage.Models.bTrex.Leg2:clone()
g.Parent = Me
local C = g:GetChildren()
for i=1, #C do
if C[i].className == "Part" then
local W = Instance.new("Weld")
W.Part0 = g.Middle
W.Part1 = C[i]
local CJ = CFrame.new(g.Middle.Position)
local C0 = g.Middle.CFrame:inverse()*CJ
local C1 = C[i].CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = g.Middle
end
local Y = Instance.new("Weld")
Y.Part0 = Me["Right Leg"]
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end
local h = g:GetChildren()
for i = 1, # h do
h[i].Anchored = false
h[i].CanCollide = false
edit: added this to top
if Me:findFirstChild("Humanoid") ~= nil and Me:findFirstChild("Chest") == nil then
