Team Spawn in Battle FIeld

Hello Everyone! No one respawned really to me and it is always annoying because no one follows up. My problem is I have a button that teleports on touch with a click detector to a map called battlefield. But the problem is I want players to teleport to two different areas team based inside of the map so it will be fair and more fun. How can I achieve this?


Could you make a second button that teleports to another location? Or do you want one button to randomize which one you teleport to?

One button because this button would teleport you to two places inside of my map, Battle Field. The Green Team spawn area and the Blue Team spawn area.

The MouseClick event of ClickDetectors tells you the player who clicked it. Then you can check their team color and decide where to teleport them.

local clickDetector = workspace.Part.ClickDetector
function onMouseClick(plr)
	if plr.TeamColor =="color") then
		-- teleport to first place
	elseif plr.TeamColor =="color2") then
		-- teleport to second place