This script's broken, what's wrong with it? This is what it does.
Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
This script is broken, it's a gamescript it's supposed to wait for 2 players, if there's not then it creates an infinate loop warning the player, until there's 2 or more, then it's supposed to create 2 teams, then team them all evenly and respawn them all, because the map will be selected. then it waits 250 seconds, and it starts over again once all players on 1 team are eliminated then they should all be in spectators.
001 | repeat wait( 0 ) until game:FindFirstChild( "Teams" ) |
004 | local A = game.Players |
005 | local A 1 = "This service is unavailable, please wait until 1 more player joins..." |
006 | local A 2 = "Welcome to the official meadows sfing game" |
008 | local A 3 = "The amount of players is successful, and the game will be starting in" .. A 4 .. "Seconds.." |
009 | local A 5 = "Teaming players..." |
010 | local A 6 = "Blue team has won" |
011 | local A 7 = "Red team has won" |
012 | local BlueTeam = game.Teams:WaitForChild( "BlueTeam" ):Clone() |
013 | local RedTeam = game.Teams:WaitForChild( "RedTeam" ):Clone() |
016 | local M = Instance.new( "Message" ,game.Workspace) |
017 | local H = Instance.new( "Hint" ,game.Workspace) |
018 | local TimeForLoop = . 5 |
021 | local GameOver = false |
022 | local RegenTeams = false |
025 | local Blue = BlueTeam:Clone() |
026 | Blue.Parent = game.Teams |
027 | local Red = RedTeam:Clone() |
028 | Red.Parent = game.Teams |
031 | function checkSpectators() |
033 | for _, player in pairs (game.Players:GetChildren()) do |
034 | if player.TeamColor = = game.Teams.Spectators.TeamColor then |
035 | spectators = spectators + 1 |
036 | if (spectators > = NumPlayers) then |
047 | for _, player in pairs (game.Players:GetPlayers()) do |
048 | if player.TeamColor = = BlueTeam.TeamColor then |
049 | players = blueplayers + 1 |
051 | if blueplayers = = 0 then |
052 | print ( "Blue team has lost" ) |
054 | elseif player.TeamColor = = RedTeam.TeamColor then |
055 | players = redplayers + 1 |
056 | if redplayers = = 0 then |
057 | print ( "Red team has lost" ) |
067 | for i,v in pairs (game.Players:GetPlayers()) do |
068 | if v and v.Character then |
069 | v.Character:BreakJoints() |
083 | coroutine.resume(coroutine.create( function () |
084 | while wait(TimeForLoop) do |
085 | if not #A:GetPlayers() > = NumPlayers then |
098 | for i = GameTime, 0 , - 1 do |
099 | H.Text = "Time left: " ..i |
105 | M.Text = "Starting new round..." |