|
| 16 Apr 2014 04:20 PM |
| How would I distribute a gui to all players in the game? |
|
|
| Report Abuse |
|
|
| |
|
FootBa11
|
  |
| Joined: 16 Sep 2008 |
| Total Posts: 11501 |
|
|
| 16 Apr 2014 04:22 PM |
gui = game.Lighting.YOURGUI
p = game.Players:GetChildren() for i = 1,#p do gui:clone().Parent = p[i].PlayerGui wait() end |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2014 04:24 PM |
Thanks FootBa11. @Gragger, Scripting helpers. If I wanted to know what do put in the starterGui, I would have asked. The word "Script" in Scripting helpers should give away that I am wanting to know how to do it via script... |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2014 09:48 PM |
Ooh, feisty. lol I'm just saying thats the easiest way to do it. |
|
|
| Report Abuse |
|
|
Krelinos
|
  |
| Joined: 09 Jan 2010 |
| Total Posts: 425 |
|
|
| 16 Apr 2014 10:11 PM |
Very well then.
function distribute() local gPlayers = game.Players.GetPlayers() for i = 1,#gPlayers do local cloneGui = Your_ScreenGui_Directory_Here:clone() cloneGui.Parent = gPlayers[i].PlayerGui end end
PS: Not tested. |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2014 10:58 PM |
for i,v in pairs(game.Players:GetChildren())do for b,n in pairs(v:FindFirstChild("PlayerGui"))do Gui = game.ReplicatedStorage.Gui:clone() Gui.Parent = n end end |
|
|
| Report Abuse |
|
|
yurhomi10
|
  |
| Joined: 10 Dec 2008 |
| Total Posts: 13886 |
|
| |
|
| |
|
|
| 16 Apr 2014 11:24 PM |
If you mean to act like it is in the startergui Game.Players.PlayerAdded:connect(function(Player) Game.ServerStroage.Gui:Clone().Parent = Player:WaitForChild("PlayerGui") end)
If you mean into the PlayerGui of people already in the game
for _, Player in pairs (Game.Players:GetPlayers()) do ypcall(function() Game.ServerStorage.Gui:Clone().Parent = Player.PlayerGui end) end |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2014 11:28 PM |
Lets bring this down to a practical Level @Above
Inside a script in workspace you can put a GUI insid eof it ans say:
function PlaceInPlayer(obj) for i,v in pairs(game.Players:GetChildren())do if v:FindFirstChild('PlayerGui')then local r=obj:Clone() r.Parent=v:FindFirstChild('PlayerGui') end end end
PlaceInPlayer(script.Gui) |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2014 11:32 PM |
| Mine was completely practical. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 16 Apr 2014 11:34 PM |
Gui = --Put your gui in lighting and put the name here. Guii = game.Lighting:FindFirstChild(Gui) c = game.Players:GetChildren()
for i = 1,#c do Guii:Clone().Parent = c[i].PlayerGui end |
|
|
| Report Abuse |
|
|
| |
|