#CharacterClone Not working

6 messages · Page 1 of 1 (latest)

ancient steeple
#

your function seems fine (albeit the limbs will probably be distorted when it works but thats a problem for later). The problem is that you are not firing the function properly

local Players = game:GetService("Players")
local player = Players.LocalPlayer

local function onCharacterAdded(character)
    character:WaitForChild("HumanoidRootPart")
    
    character.Archivable = true
    local rig = character:Clone()

    for _, descendant in pairs(rig:GetDescendants()) do
        if descendant:IsA("Script") or descendant:IsA("LocalScript") then
            descendant:Destroy()
        end
    end

    rig.HumanoidRootPart.CFrame = workspace.RigPos.CFrame
    
    for _, descendant in pairs(rig:GetDescendants()) do
        if descendant:IsA("BasePart") then
            descendant.Size = descendant.Size * 10
            descendant.Anchored = true
        end
    end
    
    rig.Parent = workspace
end

player.CharacterAdded:Connect(onCharacterAdded)

#

try this

#

oh so thats your problem

#

I thought it didnt fire at all

#
local Players = game:GetService("Players")
local player = Players.LocalPlayer

local function onCharacterAdded(character)
    character:WaitForChild("HumanoidRootPart")
    
    character.Archivable = true
    local rig = character:Clone()

    for _, descendant in pairs(rig:GetDescendants()) do
        if descendant:IsA("Script") or descendant:IsA("LocalScript") then
            descendant:Destroy()
        end
    end

    rig:PivotTo(workspace.RigPos.CFrame)
    
    for _, descendant in pairs(rig:GetDescendants()) do
        if descendant:IsA("BasePart") then
            descendant.Anchored = true
        end
    end

    rig:ScaleTo(10)
    
    rig.Parent = workspace
end

player.CharacterAdded:Connect(onCharacterAdded)

#

@tawny valve