I'm not the sharpest knife in the drawer when it comes to this. I got a gui in lighting and i want it to clone into a players playergui when the join my place.
1 | local Player = game.Players.LocalPlayer |
2 | local gui = game.Lighting [ "GUI" ] |
3 |
4 | function OnEnter(player) |
5 |
6 | end |
7 |
8 | Player.PlayerAdded:connect(OnEnter) |
:clone()
does what its name says! It copies the object, and places it wherever you choose it to. For example, if you want it to clone a GUI into a Player's PlayerGui when they first join, you wouldn't need to use LocalPlayer. You can have it as a normal script in Workspace.
1 | gui = game.Lighting [ "GUI" ] -- doesn't need to be local |
2 |
3 | game.Players.PlayerAdded:connect( function (player) |
4 | gui:clone().Parent = player.PlayerGui |
5 | end ) |