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

How do I make a spawn for the randplayer who was chosen into a team?

I am wondering, how can I make a spawn for the "randplayer" who was chosen into the team. Do I need to add a SpawnLocation?

wait(6)
while true do
   p = game.Players:GetChildren()
 randplayer = p[math.random(#p)]
 randplayer.TeamColor = game.Teams:findFirstChild("Camo").TeamColor
 randplayer.Character:BreakJoints()
 m = Instance.new("Message")
 m.Parent = workspace
 m.Text = randplayer.Name.." is the zombie! "
 wait(3)
 m.Parent = nil
  wait(8)
  for i = 1,#p do
 	   if p[i].TeamColor == BrickColor.new("Camo") then
  	      p[i].TeamColor = BrickColor.new("White")
   	     end
  	  end
    m.Parent = workspace
  m.Text = "End of game"
 wait(4)
	m.Parent = nil
end

1 answer

✓ Accepted answer

You could create a new spawn location part and make him on that "team" alone. Or, you could just move his character's Model by using

game.Workspace[randplayer.Name]:MoveTo(Vector3.new(0, 0, 0))

This method would be using a Vector3 value. Please remember to include that and look at this article for further information.

MoveTo()

1 comment

0

Or make an invisible brick, and do MoveTo(game.Workspace.Part.Position)

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