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 » Scripters
Home Search
 

Re: PlayerAdded script.

Previous Thread :: Next Thread 
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
12 Jun 2015 09:20 PM
I have a IntroGui in lighting. I have this script in Workspace, I want it to make the Gui appear when a player joins, but it's not working. Help?

PlayerGettingGui = game.Players.LocalPlayer
IntroGui = game.Lighting.IntroGui

game.Players.PlayerAdded:connect(function()
print(PlayerGettingGui.name.."Got Gui!")
IntroGui:Clone().Parent = PlayerGettingGui.PlayerGui
wait()
end)
Report Abuse
v3c3 is not online. v3c3
Joined: 04 Feb 2009
Total Posts: 674
12 Jun 2015 09:21 PM
dont use lighting for storage for one
Report Abuse
SavageMunkey is not online. SavageMunkey
Joined: 10 Jun 2012
Total Posts: 200
12 Jun 2015 09:23 PM
post this in workspace

game.Players.ChildAdded:connect(function(plr)
game.Lighting.IntroGui:Clone().Parent = plr.PlayerGui
print(plr.Name..' has received the GUI')
end)
Report Abuse
v3c3 is not online. v3c3
Joined: 04 Feb 2009
Total Posts: 674
12 Jun 2015 09:23 PM
Also You can't put it into their playergui until their character spawns

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
IntroGui:Clone().Parent = character.PlayerGui
end)
end)

implement that
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
12 Jun 2015 09:24 PM
Pauljkl told me I could.

I'll change it, and see if it works. However, please give me your second thought. I'd like to fix the problem, I don't imagine the place I put it in will affect the code.
Report Abuse
SavageMunkey is not online. SavageMunkey
Joined: 10 Jun 2012
Total Posts: 200
12 Jun 2015 09:24 PM
And also put it in Server Storage and replace Lighting with ServerStorage
Report Abuse
v3c3 is not online. v3c3
Joined: 04 Feb 2009
Total Posts: 674
12 Jun 2015 09:25 PM
Using lighting for storage is deprecated, especially when there are places designated for storing things.
Report Abuse
Adive is not online. Adive
Joined: 11 Nov 2012
Total Posts: 159
12 Jun 2015 09:25 PM

IntroGui = game.Lighting.IntroGui
game.Players.PlayerAdded:connect(function()
local intro = IntroGui:Clone()
intro.Parent = game.Players.PlayerGui
print(game.Players.LocalPlayer.." Got Gui!")
end)

Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
12 Jun 2015 09:25 PM
Alright, thanks.

Didn't know about CharacterAdded, I'll try it out.
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
12 Jun 2015 09:27 PM
Thanks, Savage!


Yours worked! :D
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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