Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make a basic gui?

Asked by 10 years ago

I looked on youtube but they were to confusing...

2 answers

Log in to vote
0
Answered by 10 years ago

It's very simple. First of all, you want to have a "ScreenGui" object, and place it into the StarterGui. There, you can now add Frame's, TextButton's, TextLabel's and other Gui objects, as long as their parent is the StarterGui.

Ad
Log in to vote
0
Answered by 10 years ago

GUI's are a lot easier than they look. Most GUIs start off with a ScreenGui instance. This can be created with.

Instance.new("ScreenGui")

After you create it you want to decide where to parent it (put it). The 2 most common places are game.StarterGui and directly into a players PlayerGui. StarterGui is used if you want the GUI to go to every player whenever they respawn, but if you don't want every player to have it or you only want someone to have it this one time, you're better of putting it directly into their PlayerGui. Also note that the effects of StarterGui can be recreated in a script using PlayerAdded and CharacterAdded.

local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "ScreenGui"
ScreenGui.Parent = game.Players.PlayerNameHere.PlayerGui

Think of ScreenGui as like the holder for all the other GUI bits. As you can see from this, I have first created it, then I named it, and then I set its parent to a PlayerGui belonging to a player with the name "PlayerNameHere", which you would of course change. Once you have created your ScreenGui, you can start to add more bits like a Frame which is a GUI with no text, often used for backgrounds and colours. You can also add TextLabels which are GUIs for text and TextBoxs which are GUIs that allow people to write text into them, often used for entering information. There is a lot you can do with GUIs, and i'm sure you will have a lot of fun messing around with them.

Answer this question