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?
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 == BrickColor.new("color") then
-- teleport to first place
elseif plr.TeamColor == BrickColor.new("color2") then
-- teleport to second place
end
end
clickDetector.MouseClick:connect(onMouseClick)