What I want to do is basically to make an intermission that will eventually transition into a match that will start depending on the number of players in the game.** I want it so that at least 4 players are in the game for the match to start. I want it to start counting down the check the number of players in the lobby. **
hint = script.Parent minplayers = 4 function CheckForPlayers() if game.Players.NumPlayers <= minplayers then hint.Text = "You need at least "..minplayers.." to start a match." Countdown() else wait (1) hint.Text = "Starting Match in: 5" wait(1) hint.Text = "Starting Match in: 4" wait(1) hint.Text = "Starting Match in: 3" wait(1) hint.Text = "Starting Match in: 2" wait(1) hint.Text = "Starting Match in: 1" wait(1) hint.Text = "Starting Match in: 0" wait(2) hint.Text = "Starting Match." wait(1) hint.Text = "Starting Match.." wait (1) hint.Text = "Starting Match..." wait(1.1) hint.Text = "Starting Match." wait(1) hint.Text = "Starting Match.." wait (1) hint.Text = "Starting Match..." wait(2) hint.Text = "Starting Match." wait(1) hint.Text = "Starting Match.." wait(1) hint.Text = "Starting Match..." wait(1.1) hint.Text = "Starting Match." wait(1) hint.Text = "Starting Match.." wait (1) hint.Text = "Starting Match..." end end function Countdown() local i = 30 while i > -1 do wait (1) hint.Text = "Intermission: " .. i CheckForPlayers() i = i - 1 end hint.Parent.Visible = true end
Mate, you forgot to call your function. If you don't call your function, nothing will run if it is inside of a function.
hint = script.Parent minplayers = 4 function CheckForPlayers() if game.Players.NumPlayers < minplayers then hint.Text = "You need at least "..minplayers.." to start a match." Countdown() else wait (1) hint.Text = "Starting Match in: 5" wait(1) hint.Text = "Starting Match in: 4" wait(1) hint.Text = "Starting Match in: 3" wait(1) hint.Text = "Starting Match in: 2" wait(1) hint.Text = "Starting Match in: 1" wait(1) hint.Text = "Starting Match in: 0" wait(2) hint.Text = "Starting Match." wait(1) hint.Text = "Starting Match.." wait (1) hint.Text = "Starting Match..." wait(1.1) hint.Text = "Starting Match." wait(1) hint.Text = "Starting Match.." wait (1) hint.Text = "Starting Match..." wait(2) hint.Text = "Starting Match." wait(1) hint.Text = "Starting Match.." wait(1) hint.Text = "Starting Match..." wait(1.1) hint.Text = "Starting Match." wait(1) hint.Text = "Starting Match.." wait (1) hint.Text = "Starting Match..." end end function Countdown() local i = 30 while i > -1 do wait (1) hint.Text = "Intermission: " .. i CheckForPlayers() i = i - 1 end hint.Parent.Visible = true end CheckForPlayers() --This is calling your function. This will run the code inside the function CheckForPlayers, which will call Countdown as you placed inside of the original function.
If I helped you, be sure to press the Accept Answer button below my character! :D