|
| 04 Jan 2014 09:08 PM |
Since the new ROBLOX update, the game data takes longer to load. If you have experienced "[YourChildName] is not a valid member of [YourParentName]" or something like that and it is perfectly correct, you must add a "[YourParentName]:WaitForChild([YourChildName]). For example, my script was:
== My Old Script == game.Players.PlayerAdded:connect(function(p) local gui = script.InformationGui:clone() gui.Parent = p.PlayerGui end)
Output was: PlayerGui is not a valid member of p Did it work: No
== My New Script [Added that WaitForChild]== game.Players.PlayerAdded:connect(function(p) local gui = script.InformationGui:clone() p:WaitForChild("PlayerGui") gui.Parent = p.PlayerGui end)
Output was: Nothing Did it work: Yes |
|
|
| Report Abuse |
|
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
| |
|
Azureous
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25287 |
|
|
| 04 Jan 2014 09:09 PM |
-_-
WaitForDataReady()
^^^^^^^^ |
|
|
| Report Abuse |
|
|
xSIXx
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 9202 |
|
|
| 04 Jan 2014 09:09 PM |
| ... you should of always done this. |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Jan 2014 09:11 PM |
xSIXx
I have studied other scripts, and it doesn't have those methods. It worked, the old script of mine was working at first, but when ROBLOX updated, it didn't work. |
|
|
| Report Abuse |
|
|
mic144
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 1598 |
|
|
| 04 Jan 2014 09:11 PM |
You should of always done this, leaks threads also the character loads before the player sometimes so.
-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ -- |
|
|
| Report Abuse |
|
|
Azureous
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25287 |
|
|
| 04 Jan 2014 09:11 PM |
| @Devil WaitForChild() has always been around or at least in Roblox.Lua |
|
|
| Report Abuse |
|
|
xSIXx
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 9202 |
|
|
| 04 Jan 2014 09:12 PM |
"I have studied other scripts, and it doesn't have those methods. It worked, the old script of mine was working at first, but when ROBLOX updated, it didn't work."
correction.
*you should of always done this if you knew what you were doing. |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 09:18 PM |
| I am posting this for other people to learn WaitForChild method, in case they don't know. |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 09:34 PM |
This isn't it
I would personally use
repeat wait() until [code]
Also the update for broken scripts with CARS was that the seat now takes HumanoidRootPart not Torso
Medium Script0r |
|
|
| Report Abuse |
|
|