API:Class/StarterPlayer

Service: This class is a service. It is a top-level singleton which can be obtained with the GetService method.
Uncreatable: This object cannot be created with Instance.new.

ExplorerImageIndex79.pngStarterPlayer : Object Icon.pngInstance

A service which allows the defaults of properties in the Player object to be set. When a player enters the server, each property of the player object is set to the current value of the corresponding property in StarterPlayer.

Additionally, you may add four objects to this service:

  • A StarterPlayerScripts instance, with scripts that run once for each player
  • A StarterCharacterScripts instance, with scripts to add to each player's character every time they spawn
  • A Humanoid instance named StarterHumanoid, which will be used as the default humanoid for each player's character
  • A Model instance named StarterCharacter, which will be used as the character model for all players

A typical structure may look something like this:

  • Tree-collapse.png
    StarterPlayer
    StarterPlayer
    • Tree-collapse.png
      StarterPlayerScripts
      StarterPlayerScripts
      • Expand.png
        LocalScript
        CameraScript
      • Expand.png
        LocalScript
        ControlScript
    • Tree-collapse.png
      StarterCharacterScripts
      StarterCharacterScripts
      • Script
        Health
      • Expand.png
        Script
        Sound
      • Expand.png
        LocalScript
        Animate
    • Expand.png
      Model
      StarterCharacter
    • Humanoid
      StarterHumanoid

Properties

PropertiesmemberhiddenProperties [toggle]

boolAutoJumpEnabled

Sets whether the character will automatically jump when hitting an obstacle on a mobile device.

|RMD member="API:Class/StarterPlayer/AutoJumpEnabled"|Sets whether the character will automatically jump when hitting an obstacle on a mobile device.|/RMD|
floatCameraMaxZoomDistance

The maximum distance the player's default camera is allowed to zoom out in studs.

|RMD member="API:Class/StarterPlayer/CameraMaxZoomDistance"|The maximum distance the player's default camera is allowed to zoom out in studs.|/RMD|
floatCameraMinZoomDistance

The minimum distance in studs the player's default camera is allowed to zoom in.

|RMD member="API:Class/StarterPlayer/CameraMinZoomDistance"|The minimum distance in studs the player's default camera is allowed to zoom in.|/RMD|
CameraModeCameraMode

Changes the default camera's mode to either first or third person.

|RMD member="API:Class/StarterPlayer/CameraMode"|Changes the default camera's mode to either first or third person.|/RMD|
DevCameraOcclusionModeDevCameraOcclusionMode

Sets how the default camera handles objects between the camera and the player.

|RMD member="API:Class/StarterPlayer/DevCameraOcclusionMode"|Sets how the default camera handles objects between the camera and the player.|/RMD|
DevComputerCameraMovementModeDevComputerCameraMovementMode

Lets developer overwrite the default camera mode for each player if the player is on a computer.

|RMD member="API:Class/StarterPlayer/DevComputerCameraMovementMode"|Lets developer overwrite the default camera mode for each player if the player is on a computer.|/RMD|
DevComputerMovementModeDevComputerMovementMode

Lets developer overwrite the player's movement mode if the player is on a computer.

|RMD member="API:Class/StarterPlayer/DevComputerMovementMode"|Lets developer overwrite the player's movement mode if the player is on a computer.|/RMD|
DevTouchCameraMovementModeDevTouchCameraMovementMode

Lets developer overwrite the default camera movement mode for each player if the player is on a mobile device.

|RMD member="API:Class/StarterPlayer/DevTouchCameraMovementMode"|Lets developer overwrite the default camera movement mode for each player if the player is on a mobile device.|/RMD|
DevTouchMovementModeDevTouchMovementMode

Lets developer overwrite the player's movement mode if the player is on a touch device.

|RMD member="API:Class/StarterPlayer/DevTouchMovementMode"|Lets developer overwrite the player's movement mode if the player is on a touch device.|/RMD|
boolEnableMouseLockOption

Determines if a player can toggle mouse lock by default.

|RMD member="API:Class/StarterPlayer/EnableMouseLockOption"|Determines if a player can toggle mouse lock by default.|/RMD|
floatHealthDisplayDistance

Sets the distance at which this player will see other Humanoid’s health bars. If set to 0, the health bars will not be displayed.

|RMD member="API:Class/StarterPlayer/HealthDisplayDistance"|Sets the distance at which this player will see other Humanoid’s health bars. If set to 0, the health bars will not be displayed.|/RMD|
boolLoadCharacterAppearance

Whether or not the appearance of a player's character should be loaded.

|RMD member="API:Class/StarterPlayer/LoadCharacterAppearance"|Whether or not the appearance of a player's character should be loaded.|/RMD|
floatNameDisplayDistance

Sets the distance at which this player will see other Humanoid’s names. If set to 0, names are hidden.

|RMD member="API:Class/StarterPlayer/NameDisplayDistance"|Sets the distance at which this player will see other Humanoid’s names. If set to 0, names are hidden.|/RMD|
boolAllowCustomAnimations [NotAccessibleSecurity] [hidden]

Describes the current game's permission levels regarding custom avatar animations from the website.

|RMD member="API:Class/StarterPlayer/AllowCustomAnimations"|Describes the current game's permission levels regarding custom avatar animations from the website.|/RMD|
Sets whether the character will automatically jump when hitting an obstacle on a mobile device.
The maximum distance the player's default camera is allowed to zoom out in studs.
The minimum distance in studs the player's default camera is allowed to zoom in.
Changes the default camera's mode to either first or third person.
Sets how the default camera handles objects between the camera and the player.
Lets developer overwrite the default camera mode for each player if the player is on a computer.
Lets developer overwrite the player's movement mode if the player is on a computer.
Lets developer overwrite the default camera movement mode for each player if the player is on a mobile device.
Lets developer overwrite the player's movement mode if the player is on a touch device.
Determines if a player can toggle mouse lock by default.
Sets the distance at which this player will see other Humanoid’s health bars. If set to 0, the health bars will not be displayed.
Whether or not the appearance of a player's character should be loaded.
Sets the distance at which this player will see other Humanoid’s names. If set to 0, names are hidden.
AllowCustomAnimations [NotAccessibleSecurity] [hidden]
Describes the current game's permission levels regarding custom avatar animations from the website.
Inherited from Object Icon.pngInstance:
boolArchivable

Determines if an object can be Clone or saved to file.

|RMD member="API:Class/Instance/Archivable"|Determines if an object can be Clone or saved to file.|/RMD|
stringClassName [readonly]

The unique name of this type of Instance.

|RMD member="API:Class/Instance/ClassName"|The unique name of this type of Instance.|/RMD|
stringName

A non-unique identifier for the object.

|RMD member="API:Class/Instance/Name"|A non-unique identifier for the object.|/RMD|
intDataCost [LocalUserSecurity] [deprecated] [readonly]

Deprecated. Do not use.

|RMD member="API:Class/Instance/DataCost"|Deprecated. Do not use.|/RMD|
boolRobloxLocked [PluginSecurity]

If true, the object and its descendants cannot be indexed or edited by a Script or LocalScript and will throw an error if it is attempted.

|RMD member="API:Class/Instance/RobloxLocked"|If true, the object and its descendants cannot be indexed or edited by a Script or LocalScript and will throw an error if it is attempted.|/RMD|
boolarchivable [deprecated] [hidden]

Deprecated in favor of Archivable.

|RMD member="API:Class/Instance/archivable"|Deprecated in favor of Archivable.|/RMD|
stringclassName [deprecated] [readonly]

Deprecated in favor of ClassName.

|RMD member="API:Class/Instance/className"|Deprecated in favor of ClassName.|/RMD|
Determines if an object can be Clone or saved to file.
ClassName [readonly]
The unique name of this type of Instance.
A non-unique identifier for the object.
DataCost [LocalUserSecurity] [deprecated] [readonly]
Deprecated. Do not use.
RobloxLocked [PluginSecurity]
If true, the object and its descendants cannot be indexed or edited by a Script or LocalScript and will throw an error if it is attempted.
archivable [deprecated] [hidden]
Deprecated in favor of Archivable.
className [deprecated] [readonly]
Deprecated in favor of ClassName.

Functions

FunctionsmemberhiddenFunctions [toggle]

Inherited from Object Icon.pngInstance:
voidClearAllChildren ( )

Removes all descendants of the object.

|RMD member="API:Class/Instance/ClearAllChildren"|Removes all descendants of the object.|/RMD|
Ref<Instance>FindFirstAncestor ( string name )

Returns the first ancestor whose Name is equal to name, or nil if none can be found.

|RMD member="API:Class/Instance/FindFirstAncestor"|Returns the first ancestor whose Name is equal to name, or nil if none can be found.|/RMD|
Ref<Instance>FindFirstAncestorOfClass ( string className )

Returns the first ancestor whose ClassName is equal to className, or nil if none can be found.

|RMD member="API:Class/Instance/FindFirstAncestorOfClass"|Returns the first ancestor whose ClassName is equal to className, or nil if none can be found.|/RMD|
Ref<Instance>FindFirstAncestorWhichIsA ( string className )

Returns the first ancestor that inherits the class className, or nil if none can be found.

|RMD member="API:Class/Instance/FindFirstAncestorWhichIsA"|Returns the first ancestor that inherits the class className, or nil if none can be found.|/RMD|
Ref<Instance>FindFirstChild ( string name, bool recursive = false )

Returns the first child found with the given name, or nil if no such child exists. If the optional recursive argument is true, recursively descends the hierarchy while searching rather than only searching the immediate object.

|RMD member="API:Class/Instance/FindFirstChild"|Returns the first child found with the given name, or nil if no such child exists. If the optional recursive argument is true, recursively descends the hierarchy while searching rather than only searching the immediate object.|/RMD|
Ref<Instance>FindFirstChildOfClass ( string className )

Returns the first Instance whose ClassName is equal to className, or nil, if no such object is found with that ClassName.

|RMD member="API:Class/Instance/FindFirstChildOfClass"|Returns the first Instance whose ClassName is equal to className, or nil, if no such object is found with that ClassName.|/RMD|
Ref<Instance>FindFirstChildWhichIsA ( string className, bool recursive = false )

Returns the first child that inherits the class className, or nil if none can be found.

|RMD member="API:Class/Instance/FindFirstChildWhichIsA"|Returns the first child that inherits the class className, or nil if none can be found.|/RMD|
array<Instance>GetChildren ( )

Returns an array of the object's children.

|RMD member="API:Class/Instance/GetChildren"|Returns an array of the object's children.|/RMD|
array<Instance>GetDescendants ( )

Returns an array containing all of the descendants of the instance.

|RMD member="API:Class/Instance/GetDescendants"|Returns an array containing all of the descendants of the instance.|/RMD|
stringGetFullName ( )

Returns a string which shows the object's ancestry chain.

|RMD member="API:Class/Instance/GetFullName"|Returns a string which shows the object's ancestry chain.|/RMD|
RBXScriptSignalGetPropertyChangedSignal ( string property )

Returns a signal that is fired when the specified property is changed on this object.

|RMD member="API:Class/Instance/GetPropertyChangedSignal"|Returns a signal that is fired when the specified property is changed on this object.|/RMD|
boolIsA ( string className )

Returns true if the object is an instance of the given class, or if the object's class inherits from the given class.

|RMD member="API:Class/Instance/IsA"|Returns true if the object is an instance of the given class, or if the object's class inherits from the given class.|/RMD|
boolIsAncestorOf ( Instance descendant )

Returns true if the object is an ancestor of the given descendant.

|RMD member="API:Class/Instance/IsAncestorOf"|Returns true if the object is an ancestor of the given descendant.|/RMD|
boolIsDescendantOf ( Instance ancestor )

Returns true if the object is a descendant of the given ancestor.

|RMD member="API:Class/Instance/IsDescendantOf"|Returns true if the object is a descendant of the given ancestor.|/RMD|
Ref<Instance>WaitForChild ( string childName, double timeOut )

Yields the current thread until a child with the given name is found, then returns the child. If the timeOut parameter is specified, this function will time out and return nil if timeOut seconds elapse without the child being found.

|RMD member="API:Class/Instance/WaitForChild"|Yields the current thread until a child with the given name is found, then returns the child.

If the timeOut parameter is specified, this function will time out and return nil if timeOut seconds elapse without the child being found.|/RMD|

stringGetDebugId ( int scopeLength = 4 ) [PluginSecurity] [notbrowsable]

Returns a coded string of the object's DebugId used internally by Roblox.

|RMD member="API:Class/Instance/GetDebugId"|Returns a coded string of the object's DebugId used internally by Roblox.|/RMD|
voidRemove ( ) [deprecated]

Deprecated. Do not use.

|RMD member="API:Class/Instance/Remove"|Deprecated. Do not use.|/RMD|
array<Instance>children ( ) [deprecated]

Deprecated in favor of GetChildren.

|RMD member="API:Class/Instance/children"|Deprecated in favor of GetChildren.|/RMD|
voiddestroy ( ) [deprecated]

Deprecated in favor of Destroy.

|RMD member="API:Class/Instance/destroy"|Deprecated in favor of Destroy.|/RMD|
InstancefindFirstChild ( string name, bool recursive = false ) [deprecated]

Deprecated in favor of FindFirstChild.

|RMD member="API:Class/Instance/findFirstChild"|Deprecated in favor of FindFirstChild.|/RMD|
array<Instance>getChildren ( ) [deprecated]

Deprecated in favor of GetChildren.

|RMD member="API:Class/Instance/getChildren"|Deprecated in favor of GetChildren.|/RMD|
boolisA ( string className ) [deprecated]

Deprecated in favor of IsA.

|RMD member="API:Class/Instance/isA"|Deprecated in favor of IsA.|/RMD|
boolisDescendantOf ( Instance ancestor ) [deprecated]

Deprecated in favor of IsDescendantOf.

|RMD member="API:Class/Instance/isDescendantOf"|Deprecated in favor of IsDescendantOf.|/RMD|
Removes all descendants of the object.
Returns the first ancestor whose Name is equal to name, or nil if none can be found.
Returns the first ancestor whose ClassName is equal to className, or nil if none can be found.
Returns the first ancestor that inherits the class className, or nil if none can be found.
FindFirstChild ( string name, bool recursive = false )
Returns the first child found with the given name, or nil if no such child exists. If the optional recursive argument is true, recursively descends the hierarchy while searching rather than only searching the immediate object.
Returns the first Instance whose ClassName is equal to className, or nil, if no such object is found with that ClassName.
FindFirstChildWhichIsA ( string className, bool recursive = false )
Returns the first child that inherits the class className, or nil if none can be found.
Returns an array of the object's children.
Returns an array containing all of the descendants of the instance.
Returns a string which shows the object's ancestry chain.
Returns a signal that is fired when the specified property is changed on this object.
IsA ( string className )
Returns true if the object is an instance of the given class, or if the object's class inherits from the given class.
IsAncestorOf ( Instance descendant )
Returns true if the object is an ancestor of the given descendant.
Returns true if the object is a descendant of the given ancestor.
WaitForChild ( string childName, double timeOut )
Yields the current thread until a child with the given name is found, then returns the child. If the timeOut parameter is specified, this function will time out and return nil if timeOut seconds elapse without the child being found.
GetDebugId ( int scopeLength = 4 ) [PluginSecurity] [notbrowsable]
Returns a coded string of the object's DebugId used internally by Roblox.
Remove ( ) [deprecated]
Deprecated. Do not use.
children ( ) [deprecated]
Deprecated in favor of GetChildren.
destroy ( ) [deprecated]
Deprecated in favor of Destroy.
findFirstChild ( string name, bool recursive = false ) [deprecated]
Deprecated in favor of FindFirstChild.
getChildren ( ) [deprecated]
Deprecated in favor of GetChildren.
isA ( string className ) [deprecated]
Deprecated in favor of IsA.
isDescendantOf ( Instance ancestor ) [deprecated]
Deprecated in favor of IsDescendantOf.


Events

EventsmemberhiddenEvents [toggle]

Inherited from Object Icon.pngInstance:
Changed ( string property )

Fires after a property of the object changes.

|RMD member="API:Class/Instance/Changed"|Fires after a property of the object changes.|/RMD|
ChildAdded ( Instance child )

Fires when a child is added to the object.

|RMD member="API:Class/Instance/ChildAdded"|Fires when a child is added to the object.|/RMD|
ChildRemoved ( Instance child )

Fires when a child is removed from the object.

|RMD member="API:Class/Instance/ChildRemoved"|Fires when a child is removed from the object.|/RMD|
DescendantAdded ( Instance descendant )

Fires when a descendant is added to the object.

|RMD member="API:Class/Instance/DescendantAdded"|Fires when a descendant is added to the object.|/RMD|
DescendantRemoving ( Instance descendant )

Fires before a descendant of the object is removed.

|RMD member="API:Class/Instance/DescendantRemoving"|Fires before a descendant of the object is removed.|/RMD|
childAdded ( Instance child ) [deprecated]

Deprecated in favor of ChildAdded.

|RMD member="API:Class/Instance/childAdded"|Deprecated in favor of ChildAdded.|/RMD|
Changed ( string property )
Fires after a property of the object changes.
Fires when a child is added to the object.
Fires when a child is removed from the object.
DescendantAdded ( Instance descendant )
Fires when a descendant is added to the object.
Fires before a descendant of the object is removed.
childAdded ( Instance child ) [deprecated]
Deprecated in favor of ChildAdded.
|RMD member="API:Class/StarterPlayer"|A service which allows the defaults of properties in the Player object to be set. When a player enters the server, each property of the player object is set to the current value of the corresponding property in StarterPlayer. Additionally, you may add four objects to this service: * A StarterPlayerScripts instance, with scripts that run once for each player * A StarterCharacterScripts instance, with scripts to add to each player's character every time they spawn * A Humanoid instance named StarterHumanoid, which will be used as the default humanoid for each player's character * A Model instance named StarterCharacter, which will be used as the character model for all players A typical structure may look something like this:
  • Tree-collapse.png
    StarterPlayer
    StarterPlayer
    • Tree-collapse.png
      StarterPlayerScripts
      StarterPlayerScripts
      • Expand.png
        LocalScript
        CameraScript
      • Expand.png
        LocalScript
        ControlScript
    • Tree-collapse.png
      StarterCharacterScripts
      StarterCharacterScripts
      • Script
        Health
      • Expand.png
        Script
        Sound
      • Expand.png
        LocalScript
        Animate
    • Expand.png
      Model
      StarterCharacter
    • Humanoid
      StarterHumanoid
|/RMD|