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: Script didn't work.. Help!

Previous Thread :: Next Thread 
Androis is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Androis
Joined: 16 Aug 2011
Total Posts: 190
01 Feb 2015 04:15 PM
Ah.. thank you.
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