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 » Scripters
Home Search
 

Re: StarterGui is not cloning to PlayerGui.

Previous Thread :: Next Thread 
xXStatixCoreXx is not online. xXStatixCoreXx
Joined: 06 Jun 2013
Total Posts: 125
12 Aug 2016 09:10 PM
So I made a simple script:
local gui = Instance.new("ScreenGui", game.StarterGui)
gui.Name = ("MainScript")

And when the game loads I can see the MainScript in the StarterGui, but not in PlayerGui.

Can anyone help me with this?
Report Abuse
Serphos is not online. Serphos
Joined: 11 Apr 2010
Total Posts: 141
12 Aug 2016 09:12 PM
Is it not in the PlayerGui if you reset?


Report Abuse
xXStatixCoreXx is not online. xXStatixCoreXx
Joined: 06 Jun 2013
Total Posts: 125
12 Aug 2016 09:13 PM
The rest of the script is..
Local Frame = Instance.new("Frame", game.Players.LocalPlayer.PlayerGui.MainScript)

and in the output it says: MainScript isn't part of PlayerGui.
Report Abuse
LegoPianoPerson is not online. LegoPianoPerson
Joined: 14 Jan 2012
Total Posts: 56
12 Aug 2016 09:14 PM
Most likely, it's a problem with the timing. You see, the script fires after the game loads, which means that the player already received the starter gui stuff. Because of this, the player doesn't get the ScreenGui. You should probably just put a screen gui inside the starter gui.
However, if you're doing this for practice, have the screen gui appear inside your gui.
Report Abuse
xXStatixCoreXx is not online. xXStatixCoreXx
Joined: 06 Jun 2013
Total Posts: 125
12 Aug 2016 09:15 PM
@Serphos it is, but is there a way to make it show up without making the person reset?
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
12 Aug 2016 09:16 PM
yes. You directly modify the playergui rather than the startergui.

for i,v in next, game.Players:GetPlayers() do
v.PlayerGui:WaitForChild('ScreenGui').Frame.Visible = true
end


Report Abuse
Serphos is not online. Serphos
Joined: 11 Apr 2010
Total Posts: 141
12 Aug 2016 09:18 PM
It's messy but you could do this instead of placing in StarterGui:

for _,v in pairs(game:GetPlayers()) do
gui.Parent = v.PlayerGui
end




Report Abuse
LegoPianoPerson is not online. LegoPianoPerson
Joined: 14 Jan 2012
Total Posts: 56
12 Aug 2016 09:19 PM
Or, alternatively, you could make it clone a copy to both the StarterGui AND the Player's Gui. To do this, establish an event where when a player enters, the script sends a copy to the Player's gui, another copy to the StarterGui, then it deletes itself.
Report Abuse
Serphos is not online. Serphos
Joined: 11 Apr 2010
Total Posts: 141
12 Aug 2016 09:21 PM
You could do that but check if it's already in StarterGui so no duplicates are made using:

if game.StarterGui:FindFirstChild(whatever) then


Report Abuse
sadman is not online. sadman
Joined: 14 Aug 2006
Total Posts: 7
12 Aug 2016 09:47 PM
wait()
local g = Instance.new("ScreenGui", game.StarterGui)
g.Name = "Main"
local F = Instance.new("Frame", g)
F.Name = "Frame1"

???
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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