StarterGui
A container for GUI objects to be copied into the PlayerGui of Players. Also provides a range of functions for interacting with the CoreGui.
Memory category | Instances |
---|
Member index 13
Removed member index 4
History | Member |
---|
Description
The StarterGui service is a container object designed to hold GUI objects such as ScreenGuis.
StarterGui as a Container
When a Player.Character respawns, the contents of their PlayerGui are emptied. Children of the StarterGui are then copied along with their descendants into the PlayerGui.
GUI objects such as ScreenGuis with their ResetOnSpawn property set to false will only be placed into each player's PlayerGui once and will not be deleted when the Player respawns.
StarterGui as an Interface
The StarterGui also includes a range of functions allowing you to interact with the CoreGui. For example StarterGui:SetCoreGuiEnabled() can be used to disable elements of the CoreGui. StarterGui:SetCore() can perform a range of functions including creating notifications and system messages.
History 50
- 573 Change ReturnType of SetCoreGuiEnabled from void to null
- 573 Change ReturnType of SetCore from void to null
- 573 Change ReturnType of RegisterSetCore from void to null
- 573 Change ReturnType of RegisterGetCore from void to null
- 564 Add RtlTextSupport
- 553 Change Default of VirtualCursorMode from to
- 553 Change Default of ShowDevelopmentGui from to
- 553 Change Default of ScreenOrientation from to
- 553 Change Default of ResetPlayerGuiOnSpawn from to
- 553 Change Default of from to
- 486 Change ThreadSafety of VirtualCursorMode from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ShowDevelopmentGui from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ScreenOrientation from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ResetPlayerGuiOnSpawn from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 479 Add VirtualCursorMode
- 462 Change ThreadSafety of CoreGuiChangedSignal from to Unsafe
- 462 Change ThreadSafety of SetCoreGuiEnabled from to Unsafe
- 462 Change ThreadSafety of SetCore from to Unsafe
- 462 Change ThreadSafety of RegisterSetCore from to Unsafe
- 462 Change ThreadSafety of RegisterGetCore from to Unsafe
- 462 Change ThreadSafety of GetCoreGuiEnabled from to Unsafe
- 462 Change ThreadSafety of GetCore from to Unsafe
- 462 Change ThreadSafety of ShowDevelopmentGui from to ReadOnly
- 462 Change ThreadSafety of ScreenOrientation from to ReadOnly
- 462 Change ThreadSafety of ResetPlayerGuiOnSpawn from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 338 Add
- 301 Change Tags of ResetPlayerGuiOnSpawn from [] to [Deprecated]
- 290 Add ScreenOrientation
- 210 Add SetCore
- 210 Add RegisterSetCore
- 210 Add RegisterGetCore
- 210 Add GetCore
- 206 Change Tags of ResetPlayerGuiOnSpawn from [Hidden] to []
- 124 Add CoreGuiChangedSignal
- 124 Add SetCoreGuiEnabled
- 124 Add GetCoreGuiEnabled
- 124 Remove
- 124 Remove
- 124 Remove
- 123 Add ResetPlayerGuiOnSpawn
- 123 Remove
- 113 Add
- 113 Add
- 113 Add
- 113 Add
- 55 Change Tags of StarterGui from [preliminary, NotCreatable, Service] to [NotCreatable, Service]
- 47 Add ShowDevelopmentGui
- 47 Add StarterGui
Members 13
CoreGuiChangedSignal
Parameters (2) | |
---|---|
coreGuiType | CoreGuiType |
enabled | bool |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 462 Change ThreadSafety of CoreGuiChangedSignal from to Unsafe
- 124 Add CoreGuiChangedSignal
GetCore
Parameters (1) | ||
---|---|---|
parameterName | string | |
Returns (1) | ||
Variant |
This method returns data set or made available by Roblox's core scripts. The first and only parameter is a string that selects the information to be fetched. The following sections describe the strings and the data they return by this function.
Calling this method may yield. Many of these also register an equivalent SetCore() function (these are marked with an asterisk).
PointsNotificationsActive*
Returns true if player point notifications are enabled.
BadgesNotificationsActive*
Returns true if badge notifications are enabled.
AvatarContextMenuEnabled*
Returns true if the Avatar Context Menu is enabled.
ChatActive*
Returns whether the chat is active or not. This is indicated by the selection state of the top bar's chat icon.
ChatWindowSize*
Returns the size of the chat window as a UDim2.
ChatWindowPosition*
Returns the size of the chat window as a UDim2.
ChatBarDisabled*
Returns true if the chat bar is disabled.
GetBlockedUserIds
Returns a list of UserIds associated with users that have been blocked by the local player.
PlayerBlockedEvent
Returns a BindableEvent that is fired whenever a player is blocked by the local player.
PlayerUnblockedEvent
Returns a BindableEvent that is fired whenever a player is unblocked by the local player.
PlayerMutedEvent
Returns a BindableEvent that is fired whenever a player is muted by the local player.
PlayerUnmutedEvent
Returns a BindableEvent that is fired whenever a player is unmuted by the local player.
PlayerFriendedEvent
Returns a BindableEvent that is fired whenever a player is friended by the local player.
PlayerUnfriendedEvent
Returns a BindableEvent that is fired whenever a player is unfriended by the local player.
DevConsoleVisible*
Returns true if the developer console is visible.
VRRotationIntensity
Returns a string describing the camera rotation sensitivity in VR: Low
,
High
and Smooth
. This will not be available unless
VRService.VREnabled is true.
Thread safety | Unsafe |
---|
GetCoreGuiEnabled
Parameters (1) | ||
---|---|---|
coreGuiType | CoreGuiType | |
Returns (1) | ||
bool |
This function returns whether the given CoreGuiType is enabled or if it has been disabled using StarterGui:SetCoreGuiEnabled(). This function should be called on the client.
Note that setting "TopbarEnabled"
to false
using
StarterGui:SetCore() hides all CoreGuiTypes but
does not affect the result of this function.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetCoreGuiEnabled from to Unsafe
- 124 Add GetCoreGuiEnabled
RegisterGetCore
Parameters (2) | ||
---|---|---|
parameterName | string | |
getFunction | Function | |
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 3
- 573 Change ReturnType of RegisterGetCore from void to null
- 462 Change ThreadSafety of RegisterGetCore from to Unsafe
- 210 Add RegisterGetCore
RegisterSetCore
Parameters (2) | ||
---|---|---|
parameterName | string | |
setFunction | Function | |
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 3
- 573 Change ReturnType of RegisterSetCore from void to null
- 462 Change ThreadSafety of RegisterSetCore from to Unsafe
- 210 Add RegisterSetCore
ResetPlayerGuiOnSpawn
Type | Default | |
---|---|---|
bool |
If set to true, each child parented to the StarterGui will be cloned into a player's PlayerGui when that player's character is respawned.
If one of the children is a PlayerGui and it has its PlayerGui property set to false, it will not be cloned.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 6
- 553 Change Default of ResetPlayerGuiOnSpawn from to
- 486 Change ThreadSafety of ResetPlayerGuiOnSpawn from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ResetPlayerGuiOnSpawn from to ReadOnly
- 301 Change Tags of ResetPlayerGuiOnSpawn from [] to [Deprecated]
- 206 Change Tags of ResetPlayerGuiOnSpawn from [Hidden] to []
- 123 Add ResetPlayerGuiOnSpawn
RtlTextSupport
Type | Default | |
---|---|---|
RtlTextSupport |
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 1
- 564 Add RtlTextSupport
ScreenOrientation
Type | Default | |
---|---|---|
ScreenOrientation |
This property sets the preferred orientation mode for users with mobile devices. For the different modes available, see ScreenOrientation.
When a Player joins the game, if they are using a mobile device, this property will determine the device's starting orientation. PlayerGui.ScreenOrientation will be set to this value for Players joining the game. For example, the following code would set the default to 'Portrait':
1
|
|
By default, this property is set to 'LandscapeSensor', meaning the viewport will rotate so it is always right-side-up in landscape.
Changing this property will not change the ScreenOrientation for Players already in the game. To change the orientation for an existing player use their PlayerGui.ScreenOrientation property.
You can also get the current screen orientation for a user's device using PlayerGui.CurrentScreenOrientation. This is useful when using the 'sensor' ScreenOrientation settings.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of ScreenOrientation from to
- 486 Change ThreadSafety of ScreenOrientation from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ScreenOrientation from to ReadOnly
- 290 Add ScreenOrientation
SetCore
Parameters (2) | ||
---|---|---|
parameterName | string | |
value | Variant | |
Returns (1) | ||
null |
This method (not to be confused with SetCoreGuiEnabled()) exposes a variety of functionality defined by Roblox's core scripts, such as sending notifications, toggling notifications for badges/points, defining a callback for the reset button, or toggling the topbar.
The first parameter is a string that selects the functionality with which the call will interact. It may be necessary to call this method multiple times using pcall() in case the respective core script has not yet loaded (or if it has been disabled entirely).
The following table describes the strings that may be accepted as the first parameter. The parameters that should follow are dependent on the functionality that will be used and are described in sub-tables.
ChatActive
Controls whether the chat is active
Name | Type | Default | Description |
---|---|---|---|
active | bool | Required | Determines whether the chat should be made active |
PointsNotificationsActive
Controls whether notifications for earned player points will appear
Name | Type | Default | Description |
---|---|---|---|
active | bool | Required | Determines whether notifications for earned player points will appear |
BadgesNotificationsActive
Controls whether notifications for earned badges will appear
Name | Type | Default | Description |
---|---|---|---|
active | bool | Required | Determines whether notifications for earned badges will appear |
ResetButtonCallback
Determines the behavior, if any, of the reset button given a bool or a BindableEvent to be fired when a player requests to reset.
Name | Type | Default | Description | |
---|---|---|---|---|
enabled | bool | Required | Determines whether the reset button retains its default behavior | |
OR | ||||
callback | BindableEvent | Required | A BindableEvent to be fired when the player confirms they want to reset |
ChatMakeSystemMessage
Display a formatted message in the chat.
Name | Type | Default | Description |
---|---|---|---|
configTable | dictionary | Required | A dictionary of information describing the message (see below) |
Name | Type | Default | Description |
---|---|---|---|
Text | string | Required | The message to display |
Color | Color3 | Color3.fromRGB(255, 255, 243) | The TextColor3 of the message |
Font | Font | SourceSansBold | The Font of the message |
TextSize | Integer | 18 | The TextSize of the message |
SendNotification
Causes a non-intrusive notification to appear at the bottom right of the screen. The notification may have up to two buttons.
Name | Type | Default | Description |
---|---|---|---|
configTable | dictionary | Required | A dictionary of information describing the notification (see below) |
Name | Type | Default | Description |
---|---|---|---|
Title | string | Required | The title of the notification |
Text | string | Required | The main text of the notification |
Icon | string | Optional | The image to display with the notification |
Duration | number | 5 | Duration (in seconds) the notification should stay visible |
Callback | BindableFunction | Optional | A BindableFunction that should be invoked with the text of the button pressed by the player. |
Button1 | string | Optional | The text to display on the first button |
Button2 | string | Optional | The text to display on the second button |
TopbarEnabled
Determines whether the topbar is displayed. Disabling the topbar will also disable all CoreGuis, such as the chat, inventory and player list (i.e. those set with SetCoreGuiEnabled).
When disabled, the region the topbar once occupied will still capture mouse events; however, buttons placed there will not respond to clicks. The origin of GUI space will still be offset 36 pixels from the top of the screen.
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | Required | Determines whether the topbar should be visible |
DevConsoleVisible
Determines whether the Developer Console is visible.
Name | Type | Default | Description |
---|---|---|---|
visibility | bool | Required | Determines whether the developer console is visible |
PromptSendFriendRequest
Prompts the current player to send a friend request to the given Player.
Name | Type | Default | Description |
---|---|---|---|
player | Player | Required | The player to which the friend request should be sent |
PromptUnfriend
Prompts the current player to remove a given Player from their friends list.
Name | Type | Default | Description |
---|---|---|---|
player | Player | Required | The player who should be unfriended |
PromptBlockPlayer
Prompts the current player to block the given Player.
Name | Type | Default | Description |
---|---|---|---|
player | Player | Required | The player who should be blocked |
PromptUnblockPlayer
Prompts the current player to unblock the given Player.
Name | Type | Default | Description |
---|---|---|---|
player | Player | Required | The player who should be unblocked |
AvatarContextMenuEnabled
Determines whether the Avatar Context Menu is enabled.
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | Required | Determines whether the Avatar Context Menu is enabled |
AvatarContextMenuTarget
Forcibly opens the Avatar Context Menu.
Name | Type | Default | Description |
---|---|---|---|
player | Player | Required | The player on whom the ACM will be opened. |
AddAvatarContextMenuOption
Adds an option to the Avatar Context Menu.
Name | Type | Default | Description | |
---|---|---|---|---|
option | AvatarContextMenuOption | Required | Friend (send friend request), Chat (start private chat), or Emote (wave) | |
OR | ||||
option | table | Required | A two-element table, where the first is the name of the custom action, and the second is a BindableEvent which will be fired with a player was selected when the option was activated. |
RemoveAvatarContextMenuOption
Removes an option to the
Avatar Context Menu. The
option
argument must be the same as what was used with
AddAvatarContextMenuOption (see above).
Name | Type | Default | Description |
---|---|---|---|
option | Variant | Required | The same value provided to AddAvatarContextMenuOption |
AvatarContextMenuTheme
Configures the customizable Avatar Context Menu (ACM) which is an opt-in feature that allows easy player-to-player social interaction via custom actions, such as initiating trades, battles, and more.
For more info on the ACM including how to customize its theme and use it in your game, see the Avatar Context Menu article.
CoreGuiChatConnections
Sets up a bindable gateway connection between the CoreGui topbar's chat button and the Lua Chat System. The second parameter must be a table of BindableEvents and BindableFunctions. See the example below for more clarification.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
Thread safety | Unsafe |
---|
SetCoreGuiEnabled
Parameters (2) | ||
---|---|---|
coreGuiType | CoreGuiType | |
enabled | bool | |
Returns (1) | ||
null |
This function sets whether the CoreGui element associated with the given CoreGuiType is enabled or disabled.
The top bar cannot be disabled using this function. To disable it, set
"TopbarEnabled"
to false
using StarterGui:SetCore().
Thread safety | Unsafe |
---|
History 3
- 573 Change ReturnType of SetCoreGuiEnabled from void to null
- 462 Change ThreadSafety of SetCoreGuiEnabled from to Unsafe
- 124 Add SetCoreGuiEnabled
ShowDevelopmentGui
Type | Default | |
---|---|---|
bool |
This property determines whether the contents of StarterGui is visible in studio
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of ShowDevelopmentGui from to
- 486 Change ThreadSafety of ShowDevelopmentGui from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ShowDevelopmentGui from to ReadOnly
- 47 Add ShowDevelopmentGui
VirtualCursorMode
Type | Default | |
---|---|---|
VirtualCursorMode |
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 3
- 553 Change Default of VirtualCursorMode from to
- 486 Change ThreadSafety of VirtualCursorMode from ReadOnly to ReadSafe
- 479 Add VirtualCursorMode