Reference API Roblox

Engine API

Website

Related

Reference API Roblox

StarterGui

A container for LayerCollector objects to be copied into the PlayerGui of Players. Also provides a range of functions for interacting with the CoreGui.

This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is a service. It is a singleton that may be acquired with GetService.
Tags: [NotCreatable, Service]

Member index 13

HistoryMember
553ResetPlayerGuiOnSpawn: bool
564RtlTextSupport: RtlTextSupport
553ScreenOrientation: ScreenOrientation
553ShowDevelopmentGui: bool
553VirtualCursorMode: VirtualCursorMode
462GetCore(parameterName: string): Variant
462GetCoreGuiEnabled(coreGuiType: CoreGuiType): bool
573RegisterGetCore(parameterName: string, getFunction: Function): null
573RegisterSetCore(parameterName: string, setFunction: Function): null
573SetCore(parameterName: string, value: Variant): null
573SetCoreGuiEnabled(coreGuiType: CoreGuiType, enabled: bool): null
462CoreGuiChangedSignal(coreGuiType: CoreGuiType, enabled: bool)
inherited from BasePlayerGui
648GetGuiObjectsAtPosition(x: int, y: int): Instances
648GetGuiObjectsInCircle(position: Vector2, radius: float): Instances
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Removed member index 4

HistoryMember

Description

StarterGui is a container object designed to hold LayerCollector objects such as ScreenGuis.

When a Player.Character spawns, the contents of their PlayerGui (if any) are emptied. Children of the StarterGui are then copied along with their descendants into the PlayerGui. Note, however, that LayerCollector 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 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, and StarterGui:SetCore() can perform a range of functions including creating notifications and system messages.

History 50

Members 13

CoreGuiChangedSignal

Parameters (2)
coreGuiTypeCoreGuiType
enabledbool

History 2

GetCore

Parameters (1)
parameterNamestring
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.

This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

GetCoreGuiEnabled

Parameters (1)
coreGuiTypeCoreGuiType
Returns (1)
bool

This function returns whether the given CoreGuiTypeis 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 SetCore() hides all CoreGuiTypes but does not affect the result of this function.

History 2

RegisterGetCore

Parameters (2)
parameterNamestring
getFunctionFunction
Returns (1)
null

History 3

RegisterSetCore

Parameters (2)
parameterNamestring
setFunctionFunction
Returns (1)
null

History 3

ResetPlayerGuiOnSpawn

TypeDefault
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.

This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 6

Tags: [Deprecated]

RtlTextSupport

TypeDefault
RtlTextSupport
This property is not scriptable. It cannot be accessed by script code.

History 1

Tags: [NotScriptable]

ScreenOrientation

TypeDefault
ScreenOrientation

This property sets the preferred screen orientation mode for users with mobile devices. For the different modes available, see ScreenOrientation.

By default, this property is set to Sensor, meaning the experience is displayed depending on the best match to the device's current orientation, either landscape (left/right) or portrait.

When a Player joins the experience on a mobile device, this property determines the device's starting orientation and sets that player's PlayerGui.ScreenOrientation accordingly. You can also get the player's current screen orientation through PlayerGui.CurrentScreenOrientation, useful when using one of the "sensor" ScreenOrientation settings.

Note that changing this property will not change the screen orientation for Players already in the experience. To change the orientation for an existing player, use their PlayerGui.ScreenOrientation property.

History 4

SetCore

Parameters (2)
parameterNamestring
valueVariant
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.

NameTypeDefaultDescription
activeboolean(required)Determines whether the chat should be made active.

PointsNotificationsActive

Controls whether notifications for earned player points will appear.

NameTypeDefaultDescription
activeboolean(required)Determines whether notifications for earned player points will appear.

BadgesNotificationsActive

Controls whether notifications for earned badges will appear.

NameTypeDefaultDescription
activeboolean(required)Determines whether notifications for earned badges will appear.

ResetButtonCallback

Determines the behavior, if any, of the reset button given a boolean or a BindableEvent to be fired when a player requests to reset.

NameTypeDefaultDescription
enabledboolean(required)Determines whether the reset button retains its default behavior.
OR
callbackBindableEvent(required)A BindableEvent to be fired when the player confirms they want to reset.

ChatMakeSystemMessage

Display a formatted message in the chat.

NameTypeDefaultDescription
configTabledictionary(required)A dictionary of information describing the message (see below).
NameTypeDefaultDescription
Textstring(required)The message to display.
ColorColor3Color3.fromRGB(255, 255, 243)Text color of the message.
FontFontSourceSansBoldFont of the message.
TextSizeinteger18Text size 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.

NameTypeDefaultDescription
configTabledictionary(required)A dictionary of information describing the notification (see below).
NameTypeDefaultDescription
Titlestring(required)The title of the notification.
Textstring(required)The main text of the notification.
IconstringThe image to display with the notification.
Durationnumber5Duration (in seconds) the notification should stay visible.
CallbackBindableFunctionA BindableFunction that should be invoked with the text of the button pressed by the player.
Button1stringThe text to display on the first button.
Button2stringThe 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 (for example, 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.

NameTypeDefaultDescription
enabledboolean(required)Determines whether the topbar should be visible.

DevConsoleVisible

Determines whether the Developer Console is visible.

NameTypeDefaultDescription
visibilityboolean(required)Determines whether the console is visible.

PromptSendFriendRequest

Prompts the current player to send a friend request to the given Player.

NameTypeDefaultDescription
playerPlayer(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.

NameTypeDefaultDescription
playerPlayer(required)The player who should be unfriended.

PromptBlockPlayer

Prompts the current player to block the given Player.

NameTypeDefaultDescription
playerPlayer(required)The player who should be blocked.

PromptUnblockPlayer

Prompts the current player to unblock the given Player.

NameTypeDefaultDescription
playerPlayer(required)The player who should be unblocked.

AvatarContextMenuEnabled

Determines whether the Avatar Context Menu is enabled.

NameTypeDefaultDescription
enabledboolean(required)Determines whether the context menu is enabled.

AvatarContextMenuTarget

Forcibly opens the Avatar Context Menu.

NameTypeDefaultDescription
playerPlayer(required)The player on whom the context menu will be opened.

AddAvatarContextMenuOption

Adds an option to the Avatar Context Menu.

NameTypeDefaultDescription
optionAvatarContextMenuOption(required)Option to add.
OR
optiontable(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).

NameTypeDefaultDescription
optionVariant(required)The same value provided to AddAvatarContextMenuOption.

AvatarContextMenuTheme

Configures the customizable Avatar Context Menu 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 how to customize its theme, see the Avatar Context Menu article.

CoreGuiChatConnections

Sets up a bindable gateway connection between the CoreGui topbar's chat button and the legacy chat system. The second parameter must be a table of BindableEvents and BindableFunctions.

History 3

SetCoreGuiEnabled

Parameters (2)
coreGuiTypeCoreGuiType
enabledbool
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().

History 3

ShowDevelopmentGui

TypeDefault
bool

This property determines whether the contents of StarterGui is visible in Studio.

History 4

VirtualCursorMode

TypeDefault
VirtualCursorMode
This property is not scriptable. It cannot be accessed by script code.

History 3

Tags: [NotScriptable]

Removed members 4

Settings