Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a game start/end feature?

Asked by
50MinZ 3
3 years ago

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
0
That does not show how to distribute everybody on to an even team and spawn them at the desired team spawn. 50MinZ 3 — 3y

1 answer

Log in to vote
0
Answered by
MattVSNNL 620 Moderation Voter
3 years ago

Scripting helpers.org is not a request site

0
I didnt request anything 50MinZ 3 — 3y
0
You asked how to make something your requesting someone to tell you how to make it MattVSNNL 620 — 3y
0
Ok so then askign any question is requesting, bruh. 50MinZ 3 — 3y
Ad

Answer this question