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

Anyone knows how to spawn chosen model to player's torso?

So i got the cloneing function to work but it dosent spawn at the character's torso. Anyone knows how to do that?

Script:

function SpawnBoxes(tab)
	for _,v in pairs(tab) do
		local BoxOfChoise = v.Box.Value
		if v.Character:findFirstChild(BoxOfChoise) == nil then
			game.ServerStorage.Boxes:FindFirstChild(BoxOfChoise):Clone().Parent = v.Character
		end
	end
end

i want it to spawn a box to every player that is in the game not just one selected player

4 comments

0

Are the boxes models?

0

yes

0

You are trying to move boxes to the position of your character's torso, correct?

0

yes

1 answer

You need to set the position of your boxes to match the torso of your character. For example, something like this would move a box model to builderman's torso:

for i,v in pairs(game.Players:GetChildren()) do
	clonedbox = box:Clone()
	clonedbox.Parent = Workspace
	clonedbox:MoveTo(game.Players.builderman.Character.Position) -- box is the box you want to move.
end

5 comments

0

Yes i know how to do that, but i want it to spawn a box to every player that is in the game not just one selected player

0

Check the updated code

0

It still dosent spawn a box beside everyone

0

It should, so I don't know if it's bug with your game or what.

0

no cus you set the it to only spawn beside player "Buildman"

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