Tokimonu
|
  |
| Joined: 18 Sep 2009 |
| Total Posts: 643 |
|
|
| 02 Jan 2015 01:51 PM |
I called the function at the bottom of the script. The gui is appearing in game, but when 2 players (or more) are in the game, the gui doesn't go away.
wait() function checkForPlayers() while true do wait(0) if game.Players.NumPlayers < 2 then script.NotEnough.Parent = game.StarterGui elseif game.Players.NumPlayers > 1 then script.Countdown.Parent = game.StarterGui game.StarterGui.NotEnough:Remove() end end end |
|
|
| Report Abuse |
|
|
Tokimonu
|
  |
| Joined: 18 Sep 2009 |
| Total Posts: 643 |
|
| |
|
ImInABlox
|
  |
| Joined: 15 Apr 2009 |
| Total Posts: 822 |
|
|
| 02 Jan 2015 01:56 PM |
| Is there something telling the GUI to go away? |
|
|
| Report Abuse |
|
|
Tokimonu
|
  |
| Joined: 18 Sep 2009 |
| Total Posts: 643 |
|
|
| 02 Jan 2015 01:59 PM |
| In the GUI? Or in the script? |
|
|
| Report Abuse |
|
|
ImInABlox
|
  |
| Joined: 15 Apr 2009 |
| Total Posts: 822 |
|
|
| 02 Jan 2015 02:02 PM |
| Anything, because there doesn't appear to be anything telling the GUI to go away, which is what your problem is. No? |
|
|
| Report Abuse |
|
|
Tokimonu
|
  |
| Joined: 18 Sep 2009 |
| Total Posts: 643 |
|
|
| 02 Jan 2015 02:02 PM |
game.StarterGui.NotEnough:Remove()
The countdown gets removed in another function. |
|
|
| Report Abuse |
|
|
Tokimonu
|
  |
| Joined: 18 Sep 2009 |
| Total Posts: 643 |
|
|
| 02 Jan 2015 02:05 PM |
Here's the whole script:
wait() function checkForPlayers() while true do wait(0) if game.Players.NumPlayers < 2 then script.NotEnough.Parent = game.StarterGui elseif game.Players.NumPlayers > 1 then script.Countdown.Parent = game.StarterGui game.StarterGui.NotEnough:Remove() end end end
wait() function countdown() if game.Players.NumPlayers < 2 then game.StarterGui.Countdown.Label2.Text = "5..." wait(1) game.StarterGui.Countdown.Label2.Text = "4..." wait(1) game.StarterGui.Countdown.Label2.Text = "3..." wait(1) game.StarterGui.Countdown.Label2.Text = "2..." wait(1) game.StarterGui.Countdown.Label2.Text = "1..." wait(1) game.StarterGui.Countdown.Label2.Text = "Game starting! Teleporting players..." wait(1) game.StarterGui.Countdown:Remove() wait(0.3) end end
wait() function teleportPlayers() target = Vector3.new(-4.433, 108.382, 81.837) for i, v in pairs(game.Players:GetChildren()) do v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 10, 0)) end end
wait() function delCountdown() if teleportPlayers() then game.StarterGui.Countdown:Remove() end end
checkForPlayers() countdown() teleportPlayers() delCountdown() |
|
|
| Report Abuse |
|
|
Tokimonu
|
  |
| Joined: 18 Sep 2009 |
| Total Posts: 643 |
|
| |
|
Fl0x
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 5169 |
|
|
| 02 Jan 2015 02:24 PM |
My best guess is, since you only remove it from the StarterGui,
game.StarterGui.NotEnough:Remove()
the players that still have the GUI keep it. You have to remove it from all players respectively. |
|
|
| Report Abuse |
|
|
Tokimonu
|
  |
| Joined: 18 Sep 2009 |
| Total Posts: 643 |
|
|
| 02 Jan 2015 02:30 PM |
| Would there be a way to move it to all of the players' PlayerGui? |
|
|
| Report Abuse |
|
|