Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to clone a model to the positions of each player?

In a game I'm working on, when a round begins, a model will be cloned at the position of each player. How exactly would I do that?

1 answer

✓ Accepted answer

Something along these lines:

local model = pathToTheModel

for num, player in ipairs( game.Players:GetPlayers() ) do
	if player.Character and player.Character:FindFirstChild( "Torso" ) then
		local copy = model:clone()
		copy.Parent = game.Workspace
		copy:MoveTo( player.Character.Torso.Position )
	end
end

If you want the model to be in front of player, replace the player.Character.Torso.Position with this: (player.Character.Torso.CFrame * CFrame.new( 0, 0, 5 )).p.

Also, you will have to set primary part for the model.

1 comment

1

You don't actually have to set the Primary Part when using MoveTo() however, it is recommended.

This discussion is preserved as it was. New answers, comments, and votes are closed.