|
| 25 Feb 2013 02:12 AM |
function onEnter(newPlr) local nP = newPlr local nPG = nP:findFirstChild("PlayerGui") local gui = game.Lighting.MenuGui:clone() gui.Parent = nPG end
game.Players.PlayerAdded:connect(onEnter)
Its supposed to give the Gui to the player when he/she enters the server. But its not...
WHY???????
The debugger picks up no errors. |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2013 02:21 AM |
MenuGui:Clone()
i think clone has a capital.
~«im gonna eat you ok»~ |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2013 02:28 AM |
Ive done it both ways on scripts and its worked. But Ill try giving it a capital.
~Build Master John~ |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2013 02:40 AM |
It didnt work.
~Build Master John~ |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2013 02:48 AM |
| The PlayerGui probably doesn't exist yet. Use the new WaitForChild member function! *thumbs up* |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2013 02:52 AM |
Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.
Thank you.
~Build Master John~ |
|
|
| Report Abuse |
|
|
dyudabomb
|
  |
| Joined: 06 Jun 2010 |
| Total Posts: 113 |
|
|
| 25 Feb 2013 08:48 AM |
| I have this same issue only it's with a model... :/ |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2013 08:57 AM |
repeat wait() until object -- You don't need ~= or == because just declairing object will make it want to search for that object to be existant, like so.
repeat wait() until game.PlayerGui
I suppose it could also be applied to a model. |
|
|
| Report Abuse |
|
|
sammy1229
|
  |
| Joined: 05 Aug 2010 |
| Total Posts: 669 |
|
|
| 25 Feb 2013 11:48 AM |
game.Players.PlayerAdded:connect(function(newPlr) repeat wait() until player.PlayerGui local gui = game.Lighting.MenuGui:clone() gui.Parent = player.PlayerGui end)
Don't make it too complicated, star. This is ALL YAH NEED |
|
|
| Report Abuse |
|
|
sammy1229
|
  |
| Joined: 05 Aug 2010 |
| Total Posts: 669 |
|
|
| 25 Feb 2013 11:49 AM |
game.Players.PlayerAdded:connect(function(newPlr) repeat wait() until newPlr.PlayerGui local gui = game.Lighting.MenuGui:clone() gui.Parent = newPlr.PlayerGui end)
sorry i forgot that you use newPlr instead of player |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2013 12:06 PM |
game.Players.PlayerAdded:connect(function(ply) repeat wait() until ply:findFirstChild("PlayerGui") game.Lighting.MenuGui:clone().Parent = ply.PlayerGui end)
findfirstchild prevents it randomly erroring. |
|
|
| Report Abuse |
|
|
H1998
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 3336 |
|
|
| 25 Feb 2013 12:11 PM |
You are all old school people....
game.Players.PlayerAdded:connect(function(ply) ply:WaitForChild("PlayerGui") game.Lighting.MenuGui:clone().Parent = ply.PlayerGui end)
Wait for child is the new trend! |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2013 12:12 PM |
| WaitForChild was actually added as a Method? When was this? |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2013 12:14 PM |
@Captain Quite a while ago. I've never used it though. |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2013 12:19 PM |
I've always known it as a Function the admins put in the top of their Code.
I still like repeat wait() until object better though....
I mean that's basically all WaitForChild does, I don't see why it was added. |
|
|
| Report Abuse |
|
|
H1998
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 3336 |
|
|
| 26 Feb 2013 08:49 AM |
| Because it is not like a loop, but an event that is fired. Where events are kind of better than loops in terms of CPU. |
|
|
| Report Abuse |
|
|