Class
PlayerScripts
NotCreatableNotReplicated
A container for client-side scripts to be run inside Player objects
within the Players service.
PlayerScripts is a container object located inside Player objects
within the Players service. It is created automatically when a player
joins the game and its main purpose is to contain client scripts copied from
the StarterPlayerScripts container within the StarterPlayer
service.
Unlike the Backpack and PlayerGui containers, the
PlayerScripts container is not accessible to the server and server‑side
Script objects will not run when parented to PlayerScripts.
Methods 8#
| ClearComputerCameraMovementModes | Unregisters all ComputerCameraMovementMode enums from the game's
settings menu. |
| ClearComputerMovementModes | Unregisters all ComputerMovementMode enums from the game's settings
menu. |
| ClearTouchCameraMovementModes | Unregisters all TouchCameraMovementMode enums from the game's settings
menu. |
| ClearTouchMovementModes | Unregisters all TouchMovementMode enums from the game's settings menu. |
| RegisterComputerCameraMovementMode | Registers that a computer camera movement mode is available to be selected from the game menu. |
| RegisterComputerMovementMode | Registers that a computer movement mode is available to be selected from the game menu. |
| RegisterTouchCameraMovementMode | Registers that a touch camera movement mode is available to be selected from the game menu. |
| RegisterTouchMovementMode | Registers that a touch movement mode is available to be selected from the game menu. |
ClearComputerCameraMovementModes(): ()#
Removes every ComputerCameraMovementMode currently registered on
this PlayerScripts instance, so the in-experience settings menu
offers no computer camera modes until one is registered again with
PlayerScripts:RegisterComputerCameraMovementMode(). The call
always notifies the settings menu, which rebuilds its camera-mode options
to reflect the now-empty set.
Returns
()
ClearComputerMovementModes(): ()#
Removes every ComputerMovementMode currently registered on this
PlayerScripts instance, so the in-experience settings menu offers
no computer movement modes until one is registered again with
PlayerScripts:RegisterComputerMovementMode(). The call always
notifies the settings menu, which rebuilds its movement-mode options to
reflect the now-empty set.
Returns
()
ClearTouchCameraMovementModes(): ()#
Removes every TouchCameraMovementMode currently registered on this
PlayerScripts instance, so the in-experience settings menu offers
no touch camera modes until one is registered again with
PlayerScripts:RegisterTouchCameraMovementMode(). The call always
notifies the settings menu, which rebuilds its camera-mode options to
reflect the now-empty set.
Returns
()
ClearTouchMovementModes(): ()#
Removes every TouchMovementMode currently registered on this
PlayerScripts instance, so the in-experience settings menu offers
no touch movement modes until one is registered again with
PlayerScripts:RegisterTouchMovementMode(). The call always
notifies the settings menu, which rebuilds its movement-mode options to
reflect the now-empty set.
Returns
()
RegisterComputerCameraMovementMode(cameraMovementMode: ComputerCameraMovementMode): ()#
Adds cameraMovementMode to the set of ComputerCameraMovementMode
options a player can select in the in-experience settings menu on
mouse-and-keyboard devices. A new PlayerScripts instance is
pre-populated with the default computer camera modes
(ComputerCameraMovementMode.Default,
ComputerCameraMovementMode.Classic, and
ComputerCameraMovementMode.Follow); the first call to this method
clears that default set so that only the modes you explicitly register are
offered, and each later call adds one more. Registering a mode notifies
the settings menu so its list of camera options updates.
| Name | Type | Default | Description |
|---|---|---|---|
cameraMovementMode | ComputerCameraMovementMode | The ComputerCameraMovementMode to add to the selectable options
in the settings menu. |
Returns
()
RegisterComputerMovementMode(movementMode: ComputerMovementMode): ()#
Adds movementMode to the set of ComputerMovementMode options a
player can select in the in-experience settings menu on mouse-and-keyboard
devices. A new PlayerScripts instance is pre-populated with the
default computer movement modes (ComputerMovementMode.Default,
ComputerMovementMode.KeyboardMouse, and
ComputerMovementMode.ClickToMove); the first call to this method
clears that default set so that only the modes you explicitly register are
offered, and each later call adds one more. Registering a mode notifies
the settings menu so its list of movement options updates.
| Name | Type | Default | Description |
|---|---|---|---|
movementMode | ComputerMovementMode | The ComputerMovementMode to add to the selectable options in
the settings menu. |
Returns
()
RegisterTouchCameraMovementMode(cameraMovementMode: TouchCameraMovementMode): ()#
Adds cameraMovementMode to the set of TouchCameraMovementMode
options a player can select in the in-experience settings menu on touch
devices. A new PlayerScripts instance is pre-populated with the
default touch camera modes (TouchCameraMovementMode.Default,
TouchCameraMovementMode.Classic, and
TouchCameraMovementMode.Follow); the first call to this method
clears that default set so that only the modes you explicitly register are
offered, and each later call adds one more. Registering a mode notifies
the settings menu so its list of camera options updates.
| Name | Type | Default | Description |
|---|---|---|---|
cameraMovementMode | TouchCameraMovementMode | The TouchCameraMovementMode to add to the selectable options in
the settings menu. |
Returns
()
RegisterTouchMovementMode(movementMode: TouchMovementMode): ()#
Adds movementMode to the set of TouchMovementMode options a
player can select in the in-experience settings menu on touch devices. A
new PlayerScripts instance is pre-populated with the default touch
movement modes (TouchMovementMode.Default,
TouchMovementMode.Thumbstick, TouchMovementMode.ClickToMove,
and TouchMovementMode.DynamicThumbstick); the first call to this
method clears that default set so that only the modes you explicitly
register are offered, and each later call adds one more. Registering a
mode notifies the settings menu so its list of movement options updates.
| Name | Type | Default | Description |
|---|---|---|---|
movementMode | TouchMovementMode | The TouchMovementMode to add to the selectable options in the
settings menu. |
Returns
()
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild