Class · inherits Instance
PlayerScripts
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 allComputerCameraMovementModeenums from the game's settings menu.Removes every
ComputerCameraMovementModecurrently registered on thisPlayerScriptsinstance, so the in-experience settings menu offers no computer camera modes until one is registered again withPlayerScripts.RegisterComputerCameraMovementMode. The call always notifies the settings menu, which rebuilds its camera-mode options to reflect the now-empty set.ClearComputerMovementModes
() → ()Unregisters allComputerMovementModeenums from the game's settings menu.Removes every
ComputerMovementModecurrently registered on thisPlayerScriptsinstance, so the in-experience settings menu offers no computer movement modes until one is registered again withPlayerScripts.RegisterComputerMovementMode. The call always notifies the settings menu, which rebuilds its movement-mode options to reflect the now-empty set.ClearTouchCameraMovementModes
() → ()Unregisters allTouchCameraMovementModeenums from the game's settings menu.Removes every
TouchCameraMovementModecurrently registered on thisPlayerScriptsinstance, so the in-experience settings menu offers no touch camera modes until one is registered again withPlayerScripts.RegisterTouchCameraMovementMode. The call always notifies the settings menu, which rebuilds its camera-mode options to reflect the now-empty set.ClearTouchMovementModes
() → ()Unregisters allTouchMovementModeenums from the game's settings menu.Removes every
TouchMovementModecurrently registered on thisPlayerScriptsinstance, so the in-experience settings menu offers no touch movement modes until one is registered again withPlayerScripts.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
cameraMovementModeto the set ofComputerCameraMovementModeoptions a player can select in the in-experience settings menu on mouse-and-keyboard devices. A newPlayerScriptsinstance is pre-populated with the default computer camera modes (ComputerCameraMovementMode.Default,ComputerCameraMovementMode.Classic, andComputerCameraMovementMode.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
movementModeto the set ofComputerMovementModeoptions a player can select in the in-experience settings menu on mouse-and-keyboard devices. A newPlayerScriptsinstance is pre-populated with the default computer movement modes (ComputerMovementMode.Default,ComputerMovementMode.KeyboardMouse, andComputerMovementMode.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
cameraMovementModeto the set ofTouchCameraMovementModeoptions a player can select in the in-experience settings menu on touch devices. A newPlayerScriptsinstance is pre-populated with the default touch camera modes (TouchCameraMovementMode.Default,TouchCameraMovementMode.Classic, andTouchCameraMovementMode.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
movementModeto the set ofTouchMovementModeoptions a player can select in the in-experience settings menu on touch devices. A newPlayerScriptsinstance is pre-populated with the default touch movement modes (TouchMovementMode.Default,TouchMovementMode.Thumbstick,TouchMovementMode.ClickToMove, andTouchMovementMode.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.