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

When a player joins, can I clone and import their avatar into a position?

Asked by
z_lm 9
3 years ago
Edited 3 years ago

When a player joins my game, I want a clone of their avatar to be put into a sitting animation in a spot, preferably I just want a script where I am able to have a player join my game, have their avatar (including accessories) cloned into a position I set for them. I wish I knew if this was easier! I'd just like to be able to make a rig for a ragdoll and clone it in the position. Sorry if this sounds repetitive, there's just a lot to say which usually loops back. Sorry if this sounds like too much for you, I thought HumanoidDescription would help but I haven't made any good progress. Can someone point me in the right direction, I can't find anything like this asked for.

0
clone = player.Character:Clone() and then clone:MoveTo(putVector3valuehere) jamespringles 105 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago

alreadyput means when a player is already at the position then the next player is at the next position

local alreadyput = 0

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        for i,plr in pairs(game.Players:GetChildren()) do
            local plrclone = plr:Clone()
            plrclone:moveTo(Vector3.new(thepositionhere)
            alreadyput = 1
            if alreadyput == 1 then
            local plrclone = plr:Clone()
            plrclone:moveTo(Vector3.new(thepositionhere)
            alreadyput = 2
            elseif alreadyput == 2 then
            local plrclone = plr:Clone()
            plrclone:moveTo(Vector3.new(thepositionhere)
            alreadyput = 3
            -- and so on
            end
        end
    end)
end)
Ad

Answer this question