Roblox UtilitiesDevlHub Roblox Documentation

Class

PlayerScripts

NotCreatableNotReplicated
Inherits
Instance › Object
Memory category
Instances

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#

ClearComputerCameraMovementModesUnregisters all ComputerCameraMovementMode enums from the game's settings menu.
ClearComputerMovementModesUnregisters all ComputerMovementMode enums from the game's settings menu.
ClearTouchCameraMovementModesUnregisters all TouchCameraMovementMode enums from the game's settings menu.
ClearTouchMovementModesUnregisters all TouchMovementMode enums from the game's settings menu.
RegisterComputerCameraMovementModeRegisters that a computer camera movement mode is available to be selected from the game menu.
RegisterComputerMovementModeRegisters that a computer movement mode is available to be selected from the game menu.
RegisterTouchCameraMovementModeRegisters that a touch camera movement mode is available to be selected from the game menu.
RegisterTouchMovementModeRegisters 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.

NameTypeDefaultDescription
cameraMovementModeComputerCameraMovementModeThe 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.

NameTypeDefaultDescription
movementModeComputerMovementModeThe 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.

NameTypeDefaultDescription
cameraMovementModeTouchCameraMovementModeThe 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.

NameTypeDefaultDescription
movementModeTouchMovementModeThe TouchMovementMode to add to the selectable options in the settings menu.
Returns
  • ()

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed