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 » Scripting Helpers
Home Search
 

Re: Distributing to all players

Previous Thread :: Next Thread 
TheStormMajor is not online. TheStormMajor
Joined: 15 Dec 2012
Total Posts: 280
16 Apr 2014 04:20 PM
How would I distribute a gui to all players in the game?
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
16 Apr 2014 04:21 PM
Put it in startergui
Report Abuse
FootBa11 is not online. 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
TheStormMajor is not online. TheStormMajor
Joined: 15 Dec 2012
Total Posts: 280
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
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
16 Apr 2014 09:48 PM
Ooh, feisty. lol
I'm just saying thats the easiest way to do it.
Report Abuse
Krelinos is not online. 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
McChicken72 is not online. McChicken72
Joined: 09 Feb 2013
Total Posts: 1115
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 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
16 Apr 2014 11:00 PM
^ wtf is this
Report Abuse
McChicken72 is not online. McChicken72
Joined: 09 Feb 2013
Total Posts: 1115
16 Apr 2014 11:01 PM
A script.
Not tested
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
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
CCDirector is not online. CCDirector
Joined: 02 Apr 2014
Total Posts: 5
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
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
16 Apr 2014 11:32 PM
Mine was completely practical.
Report Abuse
Goulstem is not online. 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
McChicken72 is not online. McChicken72
Joined: 09 Feb 2013
Total Posts: 1115
16 Apr 2014 11:35 PM
Lighting = lag
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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