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

Replica of a Player?

Asked by 2 years ago

How would I go about making a replica of a players character that copies their movements and uses their tools. An exact copy of the player.

1 answer

Log in to vote
1
Answered by 2 years ago
Edited 2 years ago

What you want may be hard, but a simple clone can be done by creating a script inside ServerScriptService.

-- Get your current Animate script, copy and paste it into ServerStorage and make it a normal Server script

game.Players.PlayerAdded:Connect(function(p)
    p.CharacterAdded:Connect(function(c)
        wait(5)
        c.Archivable = true
        local c2 = c:Clone()
        c2.Parent = workspace
        c.Archivable = false
        c2.Name = c2.Name.."Clone"
        c2.Animate:Destroy()
        game.ServerStorage.Animate:Clone().Parent = c2
        spawn(function()
            local pos = c.HumanoidRootPart.Position
            while wait(.5) do
                spawn(function()
                    wait(5)
                    c2:FindFirstChildOfClass("Humanoid"):MoveTo(pos,c.HumanoidRootPart)
                    pos = c.HumanoidRootPart.Position
                end)
            end
        end)
    end)
end)

-- This is extremely scuffed but it's the simplest way possible.

Hope this helps!

0
If this helped you, make sure to mark it as an answer so other people searching can also be helped! LikeableEmmec 470 — 2y
Ad

Answer this question