Service · inherits BasePlayerGui
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.
About StarterGui
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.
Properties 6
ClipsDescendantsSupportsRotation
: RolloutStateNotScriptableDetermines whether theClipsDescendantsproperty of aGuiObjectclips rotated descendants.If
true, theClipsDescendantsproperty of aGuiObjectclips its rotated descendants.ProcessUserInput
: booleanPluginHiddenNotReplicatedAllows this service to process input likePlayerGuiandCoreGuido.Allows
StarterGuito process input likePlayerGuiandCoreGuido. The default value isfalse.RtlTextSupport
: RtlTextSupportNotScriptableControls whether right-to-left (RTL) text layout is enabled for text inGuiObjectsthroughout the experience.This property determines whether right-to-left (RTL) text layout is applied to the text of
GuiObjectsin the experience, which is needed to correctly display languages written right-to-left, such as Arabic and Hebrew.The default value is
RtlTextSupport.Default. BothRtlTextSupport.DefaultandRtlTextSupport.Enabledturn RTL text layout support on, whileRtlTextSupport.Disabledturns it off.ScreenOrientation
: ScreenOrientationSets the default screen orientation mode for users with mobile devices.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
Playerjoins the experience on a mobile device, this property determines the device's starting orientation and sets that player'sPlayerGui.ScreenOrientationaccordingly. You can also get the player's current screen orientation throughPlayerGui.CurrentScreenOrientation, useful when using one of the "sensor"ScreenOrientationsettings.Note that changing this property will not change the screen orientation for
Playersalready in the experience. To change the orientation for an existing player, use theirPlayerGui.ScreenOrientationproperty.ShowDevelopmentGui
: booleanDetermines whether the contents ofStarterGuiis visible in Studio.This property determines whether the contents of
StarterGuiis visible in Studio.VirtualCursorMode
: VirtualCursorModeNotScriptableControls whether the gamepad virtual cursor is enabled for navigatingGuiObjectswith a controller.This property determines whether the gamepad virtual cursor, which lets players move a pointer across on-screen
GuiObjectsusing a controller, is enabled.The default value is
VirtualCursorMode.Default. Setting it toVirtualCursorMode.Enabledturns the virtual cursor on andVirtualCursorMode.Disabledturns it off. When a player is in VR, the virtual cursor is always active regardless of this property's value.
Methods 4
GetCore
(parameterName: string) → VariantYieldsReturns a variable that has been specified by a Roblox core script.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
trueif player point notifications are enabled.BadgesNotificationsActive *
Returns
trueif badge notifications are enabled.AvatarContextMenuEnabled *
Returns
trueif 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
trueif the chat bar is disabled.GetBlockedUserIds
Returns a list of
UserIdsassociated with users that have been blocked by the local player.PlayerBlockedEvent
Returns a
BindableEventthat is fired whenever a player is blocked by the local player.PlayerUnblockedEvent
Returns a
BindableEventthat is fired whenever a player is unblocked by the local player.PlayerMutedEvent
Returns a
BindableEventthat is fired whenever a player is muted by the local player.PlayerUnmutedEvent
Returns a
BindableEventthat is fired whenever a player is unmuted by the local player.PlayerFriendedEvent
Returns a
BindableEventthat is fired whenever a player is connected by the local player.PlayerUnfriendedEvent
Returns a
BindableEventthat is fired whenever a player is unconnected by the local player.DevConsoleVisible *
Returns
trueif the Developer Console is visible.VRRotationIntensity
Returns a string describing the camera rotation sensitivity in VR:
Low,HighandSmooth. This will not be available unlessVRService.VREnabledistrue.GetCoreGuiEnabled
(coreGuiType: CoreGuiType) → booleanReturns whether the givenCoreGuiTypeis enabled, or if it has been disabled usingStarterGui.SetCoreGuiEnabled.This function returns whether the given
CoreGuiTypeis enabled, or if it has been disabled usingStarterGui.SetCoreGuiEnabled. This function should be called on the client.Note that setting
"TopbarEnabled"tofalseusingSetCore()hides allCoreGuiTypesbut does not affect the result of this function.SetCore
(parameterName: string, value: Variant) → ()Allows you to perform certain interactions with Roblox's core scripts.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
LuaGlobals.pcallin 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.
PointsNotificationsActive
Controls whether notifications for earned player points will appear.
BadgesNotificationsActive
Controls whether notifications for earned badges will appear.
ResetButtonCallback
Determines the behavior, if any, of the reset button given a boolean or a
BindableEventto be fired when a player requests to reset.ChatMakeSystemMessage
Display a formatted message in the chat. Using this method requires the experience's
TextChatService.ChatVersionto be set toLegacyChatService, although legacy chat is deprecated and usage is discouraged. For experiences using the currentTextChatService, refer toTextChannel.DisplaySystemMessage.SendNotification
Causes a non-intrusive notification to appear at the bottom right of the screen. The notification may have up to two buttons.
TopbarEnabled
Determines whether the topbar is displayed. Disabling the topbar will also disable all
CoreGuissuch as the chat, inventory, and player list (for example, those set withSetCoreGuiEnabled).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.
DevConsoleVisible
Determines whether the Developer Console is visible.
PromptSendFriendRequest
Prompts the current player to send a friend request to the given
Player.PromptUnfriend
Prompts the current player to remove a given
Playerfrom their friends list.PromptBlockPlayer
Prompts the current player to block the given
Player.PromptUnblockPlayer
Prompts the current player to unblock the given
Player.AvatarContextMenuEnabled
Determines whether the Avatar Context Menu is enabled.
AvatarContextMenuTarget
Forcibly opens the Avatar Context Menu.
AddAvatarContextMenuOption
Adds an option to the Avatar Context Menu.
RemoveAvatarContextMenuOption
Removes an option to the Avatar Context Menu. The
optionargument must be the same as what was used with"AddAvatarContextMenuOption"(see above).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
CoreGuitopbar's chat button and the legacy chat system. The second parameter must be a table ofBindableEventsandBindableFunctions.SetCoreGuiEnabled
(coreGuiType: CoreGuiType, enabled: boolean) → ()Sets whether theCoreGuielement associated with the givenCoreGuiTypeis enabled or disabled.This function sets whether the
CoreGuielement associated with the givenCoreGuiTypeis enabled or disabled.The top bar cannot be disabled using this function. To disable it, set
"TopbarEnabled"tofalseusingStarterGui.SetCore.
StarterGui also has every member of BasePlayerGui. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.