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 » Scripting Helpers
Home Search
 

Re: Why does it completely skip over this?

Previous Thread :: Next Thread 
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
05 Jan 2014 04:04 PM
game.Players.PlayerAdded:connect(function(p)
p:WaitForChild("PlayerGui"):WaitForChild("LastManStanding")
end)






it just simply doesn't wait for those to exist and just skips them
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
05 Jan 2014 05:40 PM
bump
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
05 Jan 2014 06:07 PM
???
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
05 Jan 2014 07:06 PM
Do ya'll need any other info to help me or?
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
05 Jan 2014 07:06 PM
WaitForChild() can be buggy.
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
05 Jan 2014 07:17 PM
any other method of waiting for a player to be completely loaded before continuing a script?
Report Abuse
insaneROBLOXER123 is not online. insaneROBLOXER123
Joined: 23 Nov 2011
Total Posts: 192
05 Jan 2014 07:17 PM
Use repeat wait() until p.PlayerGui:findFirstChild("LastManStanding")

-insane-enasni-
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
05 Jan 2014 07:24 PM
@insane

Output said PlayerGui is a nil value

so I tried

repeat wait() until p:findFirstChild("PlayerGui")

and output said attempt to call method "findFirstChild" is a nil value
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
05 Jan 2014 07:25 PM
wait derp it's FindFirstChild
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
05 Jan 2014 07:26 PM
That still didn't work
Report Abuse
Azureous is not online. Azureous
Joined: 29 Jan 2012
Total Posts: 25287
05 Jan 2014 07:42 PM
if p and p.PlayerGui then
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
05 Jan 2014 08:09 PM
@Azure

That doesn't work, because i need it to keep waiting until they exist

not just check one time and if not then stop everything
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
05 Jan 2014 08:15 PM

repeat wait() until p:findFirstChild("PlayerGui") and p.PlayerGui:findFirstChild("LastManStanding")
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
05 Jan 2014 08:18 PM
Ok so is this all I need?

p = game.Players:GetPlayers()
repeat wait() until p:findFirstChild("PlayerGui") and p.PlayerGui:findFirstChild("LastManStanding")
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
05 Jan 2014 08:39 PM
bump
Report Abuse
VilleSlay is not online. VilleSlay
Joined: 14 May 2011
Total Posts: 1405
05 Jan 2014 08:43 PM
GetPlayers() creates a table. You would have to loop through the table unless you want the script to wait for every single player's PlayerGui.

~~> Ville <~~
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
05 Jan 2014 10:41 PM
I do want to wait for every player's PlayerGui to load

How do I go about doing that
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
05 Jan 2014 10:48 PM
Bump
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
06 Jan 2014 12:53 PM
b2
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
06 Jan 2014 02:06 PM
bump
Report Abuse
Scriptos is online. Scriptos
Joined: 17 Jun 2008
Total Posts: 2900
06 Jan 2014 02:08 PM
for i,v in pairs(game.Players:GetChildren()) do
if (v:findFirstChild("PlayerGui")) then
--Code here.
end end;
Report Abuse
Scriptos is online. Scriptos
Joined: 17 Jun 2008
Total Posts: 2900
06 Jan 2014 02:10 PM
Oops, sorry. Didn't read the whole thing.

game.Players.PlayerAdded:connect(function(p)
repeat wait() until p:findFirstChild("PlayerGui"):findFirstChild("LastManStanding");
--code
end);
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
06 Jan 2014 02:20 PM
@scriptos

No error, but nothing happened, as in it didn't carry on the script
Report Abuse
EcIiptic is not online. EcIiptic
Joined: 12 Aug 2009
Total Posts: 13737
06 Jan 2014 02:23 PM
TheInnovative

If you are using the PlayerAdded event on play solo test then it won't work.

Try going to an actual server and test it.

If that's not it, then I have no idea.
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
06 Jan 2014 02:27 PM
You can try :WaitForDataReady()

If I'm not mistaken, the player is already fully loaded before roblox readies player data.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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