I am trying to make it so that when a player joins the game a value gets cloned into their playergui but I can't seem to do it. Could someone help? Thanks!
1 | local clone = game.ServerStorage.canuseresearch:Clone() |
2 |
3 | game.Players.PlayerAdded:Connect( function (player) |
4 | wait( 1 ) |
5 | print (player.Name .. " joined the game!" ) |
6 | clone.Parent = game.Players [ player.Name ] .PlayerGui.ScreenGui |
7 | end ) |
Place Inside workspace btw it takes 1.2 seconds for all scripts to load in, any time you are defining a new child which in this case is ScreenGUI. always add a wait for 1.2 seconds
1 | local a = game.ServerStorage.canuseresearch:Clone() |
2 |
3 | game.Players.PlayerAdded:Connect( function (plr) |
4 |
5 | wait( 1.2 ) |
6 | print (plr.Name .. " joined the game!" ) |
7 |
8 | a.Parent = plr.PlayerGui.ScreenGui |
9 | end ) |