jknite
|
  |
| Joined: 30 Nov 2007 |
| Total Posts: 614 |
|
|
| 16 Jun 2014 11:25 PM |
I am having issues with a GUI Giver upon entry of the game. I have tried using different set ups for this script but the point is to give me a moderation GUI that I have created. It returns with PlayerGui and StarterGui being nil, no matter which I set it to. Any suggestions? I have tried obtaining the GUI through the Lighting and being within the actual script. The script is below. I know the pathway that I used in this script was valid a few years ago.
function onPlayerAdded(plr) if plr.userId == 109008 then game.Lighting.ModGUI:Clone().Parent = plr.StarterGui end end game.Players.PlayerAdded:connect(onPlayerAdded) |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 16 Jun 2014 11:27 PM |
function onPlayerAdded(plr) if plr.userId == 109008 then plrgui = plr:WaitForChild("PlayerGui") game.Lighting:FindFirstChild("ModGUI"):Clone().Parent = plrgui end end
game.Players.PlayerAdded:connect(onPlayerAdded)
--should work perfectly. if not, change findfirstchild to waitforchild |
|
|
| Report Abuse |
|
|
|
| 16 Jun 2014 11:29 PM |
game.Players.PlayerAdded:connect(function(plr) if plr.userId == 109008 then repeat wait() until plr.Character and plr:FindFirstChild("PlayerGui") -- Just incase y'know... game.Lighting.ModGUI:Clone().Parent = plr.PlayerGui end end
Try that, good luck. Hope it fixes your problem. |
|
|
| Report Abuse |
|
|
|
| 16 Jun 2014 11:29 PM |
game.Players.PlayerAdded:connect(function(plr) if plr.userId == 109008 then repeat wait() until plr.Character and plr:FindFirstChild("PlayerGui") -- Just incase y'know... game.Lighting.ModGUI:Clone().Parent = plr.PlayerGui end end)
-- Ignore the last one, I left a mistake. Try this one instead. |
|
|
| Report Abuse |
|
|