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

How to make a game start/end feature?

So I want to make it so after 5 minutes of being on the main map, your are teleported to the lobby, after that a countdown from 60 will begin and at the end of that it will evenly assign teams and teleport you to the map, then after that, countdown from 5 minutes to go back to the lobby, e.t.c, Ive been given this peice of code:


for i = 60, 1, -1 do
	    status.Value = "Intermission - " .. i
	    wait(1)
	end
 
wait(2)
status.Value = "Round starting, get ready!"
wait(1)

local list = game.Players:GetPlayers() local Teams = {game.Teams["Red Team"], game.Teams["Blue Team"]}

for _ = 1, #list do
	    local index = math.random(1, #list) -- randomly choose an index that leads to a player
	    local player = list[index] -- gets the randomly chosen player
	    player.Team = Teams[ (#list % 2) + 1 ] -- chooses player's team; explanation below
   table.remove(list, index) -- removes the player from the list so that they aren't chosen again
	end

2 comments

0

That does not show how to distribute everybody on to an even team and spawn them at the desired team spawn.

1 answer

Scripting helpers.org is not a request site

3 comments

0

I didnt request anything

0

You asked how to make something your requesting someone to tell you how to make it

0

Ok so then askign any question is requesting, bruh.

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