Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How can I make a player clone spawn properly?

Asked by 5 years ago

I have a clone player script which clones the player, but the clone doesn't have a shirt or pants or any accessories. How would I fix this? Here is my script:

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        char.Archivable = true
        local d = char:Clone()
        d.Parent = game.Workspace

        d.UpperTorso.CFrame = CFrame.new(0,50,0)

    end)
end)

1 answer

Log in to vote
0
Answered by 5 years ago

Your character was loading in too quickly meaning that the clone would spawn before any of the textures had been fully loaded.

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
    char:WaitForChild("Shirt" and "Pants")
        char.Archivable = true
        local d = char:Clone()
        d.Parent = game.Workspace

        d.UpperTorso.CFrame = CFrame.new(0,50,0)

    end)
end)

If this helped, don't forget to give it an Up vote!

0
Thank you! CaptainD_veloper 290 — 5y
0
You're welcome! :) xXTouchOfFrostXx 125 — 5y
Ad

Answer this question