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
 

GUI Giver Issue

Previous Thread :: Next Thread 
jknite is not online. 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 is not online. 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
ninjaxrasx is not online. ninjaxrasx
Joined: 29 May 2008
Total Posts: 757
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
ninjaxrasx is not online. ninjaxrasx
Joined: 29 May 2008
Total Posts: 757
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
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