Androis
|
  |
| Joined: 16 Aug 2011 |
| Total Posts: 190 |
|
|
| 01 Feb 2015 11:46 AM |
wait(1) function Gui() Instance.new("ScreenGui", game.StarterGui) Instance.new("TextBox", game.StarterGui.ScreenGui) game.StarterGui.ScreenGui.TextBox.Text = "The script worked" end
Gui()
When I updated the game and joined it, nothing showed up. |
|
|
| Report Abuse |
|
|
compy111
|
  |
| Joined: 02 Apr 2009 |
| Total Posts: 583 |
|
|
| 01 Feb 2015 11:56 AM |
StarterGui is the Gui you get when your character spawns, just like StarterPack is the tools you get when your character spawns.
If you want to give a Gui to an already existing character you have to put it in PlayerGui.
---------------------------- function Gui() screengui = Instance.new("ScreenGui",game.Players.-PLAYERNAME-.PlayerGui) textbox = Instance.new("TextBox",screengui) end
Gui() --------------------------
This script will first add a screengui to the player. You will have to use other functions to get the player or use a localscript, put the script inside of StarterGui and use game.Players.LocalPlayer.PlayerGui Then it will add a textbox inside of the screengui, this textbox has a size of 0,0,0,0 which means it isn't visible. You will have to set textbox.Size = UDim2.new(0,100,0,100) in order to see the textbox. |
|
|
| Report Abuse |
|
|
Androis
|
  |
| Joined: 16 Aug 2011 |
| Total Posts: 190 |
|
|
| 01 Feb 2015 11:57 AM |
| How can I make it available to ALL players at the same time? |
|
|
| Report Abuse |
|
|
compy111
|
  |
| Joined: 02 Apr 2009 |
| Total Posts: 583 |
|
|
| 01 Feb 2015 12:44 PM |
I never add Gui's with a script.
I always build a gui inside of Roblox studio, inside of the StarterGui.
When a player joins the world, he automaticly gets a copy of the StarterGui, that copy is placed in LocalPlayer.PlayerGui which makes him see the Gui.
If you don't want the Gui to be shown from the start of the game you can disable the Visible property of the TextBox and later enable that by a script. |
|
|
| Report Abuse |
|
|
Androis
|
  |
| Joined: 16 Aug 2011 |
| Total Posts: 190 |
|
| |
|