Skip to content

Class · inherits Instance

PlayerScripts

Official docs ↗

A container for client-side scripts to be run inside Player objects within the Players service.

About PlayerScripts

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.

    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.

  • ClearComputerMovementModes() → ()Unregisters all ComputerMovementMode enums from the game's settings menu.

    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.

  • ClearTouchCameraMovementModes() → ()Unregisters all TouchCameraMovementMode enums from the game's settings menu.

    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.

  • ClearTouchMovementModes() → ()Unregisters all TouchMovementMode enums from the game's settings menu.

    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.

  • RegisterComputerCameraMovementMode(cameraMovementMode: ComputerCameraMovementMode) → ()Registers that a computer camera movement mode is available to be selected from the game menu.

    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.

  • RegisterComputerMovementMode(movementMode: ComputerMovementMode) → ()Registers that a computer movement mode is available to be selected from the game menu.

    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.

  • RegisterTouchCameraMovementMode(cameraMovementMode: TouchCameraMovementMode) → ()Registers that a touch camera movement mode is available to be selected from the game menu.

    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.

  • RegisterTouchMovementMode(movementMode: TouchMovementMode) → ()Registers that a touch movement mode is available to be selected from the game menu.

    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.

PlayerScripts also has every member of Instance. 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.