|
| 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
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 674 |
|
|
| 12 Jun 2015 09:21 PM |
| dont use lighting for storage for one |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 12 Jun 2015 09:24 PM |
| And also put it in Server Storage and replace Lighting with ServerStorage |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 12 Jun 2015 09:25 PM |
Alright, thanks.
Didn't know about CharacterAdded, I'll try it out. |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 09:27 PM |
Thanks, Savage!
Yours worked! :D |
|
|
| Report Abuse |
|
|