generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Something is wrong?

Previous Thread :: Next Thread 
Tokimonu is not online. 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 is not online. Tokimonu
Joined: 18 Sep 2009
Total Posts: 643
02 Jan 2015 01:56 PM
Bump^
Report Abuse
ImInABlox is not online. 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 is not online. Tokimonu
Joined: 18 Sep 2009
Total Posts: 643
02 Jan 2015 01:59 PM
In the GUI? Or in the script?
Report Abuse
ImInABlox is not online. 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 is not online. 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 is not online. 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 is not online. Tokimonu
Joined: 18 Sep 2009
Total Posts: 643
02 Jan 2015 02:21 PM
Bump^
Report Abuse
Fl0x is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image