The AccountAge is a Player property that describes how long ago a
player's account was registered in days. It is set using the
Player:SetAccountAge() function, which cannot be accessed by
scripts.
This property is useful for conditionally showing new Roblox players
content such as tutorials.
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
History 5
Tags: [ReadOnly, NotReplicated]
It cannot be accessed by script code.
It is not meant to be used, and may have unresolved issues.
History 2
Tags: [Hidden, NotScriptable]
It exists only for backward compatibility, and should not be used for new work.
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
It is not meant to be used, and may have unresolved issues.
History 7
Tags: [Hidden, ReadOnly, NotReplicated, Deprecated]
The AutoJumpEnabled property determines whether the
Player.Character of a Player using a mobile device will
automatically jump when they hit an obstacle. This can make levels more
navigable while on a mobile device.
When the player joins the game, the StarterPlayer.AutoJumpEnabled
value determines the initial state of this property. Then, this property
determines the value of the Humanoid.AutoJumpEnabled property of
the Player.Character on spawn. In other words, it is possible to
set the auto-jump behavior on a per-character, per-player and per-game
basis using these three properties.
History 5
The CameraMaxZoomDistance Player property sets the maximum
distance in studs the camera can be from the character with the default
cameras.
In other words, it controls the maximum distance the player's camera is
allowed to zoom out.
The default value of this property is set by
StarterPlayer.CameraMaxZoomDistance. If this value is set to a
lower value than Player.CameraMinZoomDistance, it will be
increased to CameraMinZoomDistance.
History 5
The CameraMinZoonDistance Player property sets the minimum
distance in studs the camera can be from the character with the default
cameras.
In other words, it controls the minimum distance the player's camera is
allowed to zoom in.
The default value of this property is set by
StarterPlayer.CameraMinZoomDistance. If this value is set to a
higher value than Player.CameraMaxZoomDistance it will be
decreased to CameraMaxZoomDistance.
History 5
The CameraMode property sets the player's camera mode, defaulting to
third person.
Third Person
In the default third person mode (CameraMode.Classic), the
character can be seen in the camera. While in this mode, the default
behavior is:
- Players can right-click and drag (mouse), tap and drag (mobile), use the
secondary thumbstick (gamepad), or press the left/right arrows
(keyboard) to rotate the camera around their character.
- When a player moves their character, it faces in the corresponding
movement direction.
- Players can zoom in and out freely, even to first person on full zoom
in.
First Person
In first person mode (CameraMode.LockFirstPerson), the player's
camera is zoomed all the way in. Unless there is a visible GUI present
with the GuiButton.Modal property set to true
, moving the mouse,
tap-dragging on mobile, or using the secondary thumbstick on a gamepad
will rotate the camera around the character.
History 5
CanLoadCharacterAppearance
The CanLoadCharacterAppearance Player property determines whether
the character's appearance will be loaded when the player spawns. The
default value of this property is set by
StarterPlayer.LoadPlayerAppearance.
If true, the character will load the appearance of the player
corresponding to the player's Player.CharacterAppearanceId.
If false, the player will spawn with a default appearance - a grey
character model without any hats, shirts, pants, etc.
Attempting to set the property after the character has spawned will not
change the character, you must call Player:LoadCharacter() to load
the new appearance.
History 5
The Character property contains a reference to a Model
containing a Humanoid, body parts, scripts, and other objects
required for simulating the player's avatar in-experience. The model is
parented to the Workspace but it may be moved. It is automatically
loaded when Players.CharacterAutoLoads is true
and it can be
manually loaded otherwise using Player:LoadCharacter().
Initially this property is nil
and it is set when the player's character
first spawns. Use the Player.CharacterAdded event to detect when a
player's character properly loads, and the
Player.CharacterRemoving event to detect when the character is
about to despawn. Avoid using Object:GetPropertyChangedSignal() on
this property.
Note that LocalScripts that are cloned from
StarterGui or StarterPack into a player's
PlayerGui or Backpack respectively are often run before
the old character model is replaced, so Player.Character may refer
to the old model whose Parent property is nil
.
Therefore, in a LocalScript under StarterGui or
StarterPack, it is advisable to make sure the parent of
Character is not nil
before using it, for example:
1
2
3
4
5
6
7
| local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character
if not character or character.Parent == nil then
character = player.CharacterAdded:Wait()
end
|
History 6
Parameters (1) |
---|
character | Model |
The CharacterAdded event fires when a player's character spawns (or
respawns). This event fires soon after setting Player.Character to
a non-nil
value or calling Player:LoadCharacter(), which is
before the character is parented to the Workspace.
This can be used alongside the Player.CharacterRemoving event,
which fires right before a player's character is about to be removed,
typically after death. As such, both of these events can potentially fire
many times as players die then respawn in a place. If you want to detect
when a player joins or leaves the game, use the
Players.PlayerAdded and Players.PlayerRemoving events
instead.
Note that the Humanoid and its default body parts (head, torso,
and limbs) will exist when this event fires, but clothing items like
Hats, Shirts, and Pants may take a few
seconds to be added to the character. Connect Instance.ChildAdded
on the added character to detect these, or wait for the
Player.CharacterAppearanceLoaded event to be sure the character
has everything equipped.
History 3
The CharacterAppearance property indicates the URL of the asset containing
the character's appearance, clothing, and gear.
It is automatically set by Roblox to load your avatar's appearance when
you join a game.
Attempting to set the property after the character has spawned will not
change the character, you must call Player:LoadCharacter() to load
the new appearance.
It exists only for backward compatibility, and should not be used for new work.
CharacterAppearanceId should be used instead.
It is not visible in Studio's object browser.
History 6
Tags: [NotBrowsable, Deprecated]
This property determines the user ID of the account whose character
appearance is used for a player's character. By
default, this property is the Player.UserId, which uses the
player's avatar as they have created it on the Roblox website.
Changing this property to the user ID of another account will cause the
player to spawn with that account's appearance (hats, shirt, pants, etc).
Games can also toggle whether or not a player's character appearance is
loaded in game by changing the
StarterPlayer.LoadCharacterAppearance property.
History 6
CharacterAppearanceLoaded
Parameters (1) |
---|
character | Model |
History 3
Parameters (1) |
---|
character | Model |
The CharacterRemoving event fires right before a player's character is
removed, such as when the player is respawning.
This event can be used alongside the Player.CharacterAdded event,
which fires when a player's character spawns or respawns. For instance, if
you would like to print a message every time a player spawns and dies:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| local Players = game:GetService("Players")
local function onCharacterSpawned(player)
print(player.Name .. " is spawning")
end
local function onCharacterDespawned(player)
print(player.Name .. " is despawning")
end
local function onPlayerAdded(player)
player.CharacterAdded:Connect(function()
onCharacterSpawned(player)
end)
player.CharacterRemoving:Connect(function()
onCharacterDespawned(player)
end)
end
Players.PlayerAdded:Connect(onPlayerAdded)
|
This event is only concerned with the Character
of a Player. If you instead need to track when a player
joins/leaves the game, use the events Players.PlayerAdded and
Players.PlayerRemoving.
History 3
It cannot be accessed by script code.
It is not meant to be used, and may have unresolved issues.
History 2
Tags: [Hidden, NotScriptable]
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
It is not meant to be used, and may have unresolved issues.
History 6
Tags: [Hidden, ReadOnly, NotReplicated]
It cannot be accessed by script code.
It is not meant to be used, and may have unresolved issues.
History 2
Tags: [Hidden, NotScriptable]
The Chatted event fires when a Player types a message and presses
enter in Roblox's provided chat bar. This is done using some Lua bindings
by the default chat script. You can prevent players from chatting by using
StarterGui:SetCoreGuiEnabled() and disabling the Chat
CoreGuiType.
Chat Commands
Using this event and some string manipulation functions like
string.sub() and string.lower(), it is possible to
create chat commands, even with arguments like player names. Usually,
commands are prefixed such as heal PlayerName
. To check for a prefix in
a string, use string.sub() on the message to check a substring
of the message: string.sub(message, 1, 6) == "/heal "
(note the
inclusion of the space). Then, extract the rest of the command using
string.sub() again: string.sub(message, 7)
will be equal to
the player name. Check if that player exists, and if so, perform the
command's action (in this example, healing them). Check the code samples
for examples of chat commands.
Filtering
The message text fired with this event is unfiltered. If you are
displaying player input like chat to other players in any form, it must be
filtered using Chat:FilterStringAsync(). Keep this in mind when
creating your own chat systems; if your game does not properly filter chat
it may have moderation action taken against it.
History 3
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
null |
The ClearCharacterAppearance function removes all Accessory,
Shirt, Pants, CharacterMesh, and
BodyColors from the given player's Player.Character. In
addition, it also removes the T-Shirt Decal on the player's torso.
The character's body part colors and face will remain unchanged. This
method does nothing if the player does not have a Character.
It does not remove t-shirts, head meshes, or faces.
History 3
CloudEditCameraCoordinateFrame
It cannot be accessed by script code.
It is not meant to be used, and may have unresolved issues.
History 2
Tags: [Hidden, NotScriptable]
It cannot be accessed by script code.
It is not meant to be used, and may have unresolved issues.
History 2
Tags: [Hidden, NotScriptable]
CloudEditSelectionChanged
Parameters (1) |
---|
newSelection | Array |
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
Parameters (0) |
---|
No parameters. |
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
CountryRegionCodeReplicate
It cannot be accessed by script code.
It is not meant to be used, and may have unresolved issues.
History 2
Tags: [Hidden, NotScriptable]
This property was once used by an ancient data persistence method to
indicate the total amount of data currently being stored in the player's
cache on the current place.
Notes
- Booleans and numbers cost 1 data complexity unit.
- Strings cost their length divided by 100 in data complexity units.
- Instances cost their DataCost in data complexity units.
- Saving the default value (0 for numbers, false for booleans, "" for
strings and nil for Instances) removes the key from the DataComplexity
count.
- If, when using the SaveBoolean, SaveString, SaveNumber or SaveInstance
functions, the DataComplexity for the player goes over the limit
(currently 45000 units, defined by DataComplexityLimit), the function
throws an error, the value is not saved, and any previous value of the
key that was being saved to is deleted.
It exists only for backward compatibility, and should not be used for new work.
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
It is not meant to be used, and may have unresolved issues.
History 7
Tags: [Hidden, ReadOnly, NotReplicated, Deprecated]
It exists only for backward compatibility, and should not be used for new work.
Its interface does not cross the network boundary.
It is not meant to be used, and may have unresolved issues.
History 8
Tags: [Hidden, NotReplicated, Deprecated]
This property was once used by an ancient data persistence method to
indicate when the player's data is available to load. Becomes true when
data is available.
It exists only for backward compatibility, and should not be used for new work.
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
It is not meant to be used, and may have unresolved issues.
History 7
- 554
Change Default of DataReady
from
false
to
- 553
Change Default of DataReady
from
to
false
- 486
Change ThreadSafety of DataReady
from
ReadOnly
to
ReadSafe
- 469
Change Tags of DataReady
from
[ReadOnly, NotReplicated, Deprecated]
to
[Hidden, ReadOnly, NotReplicated, Deprecated]
- 462
Change ThreadSafety of DataReady
from
to
ReadOnly
- 252
Change Tags of DataReady
from
[ReadOnly, NotReplicated]
to
[ReadOnly, NotReplicated, Deprecated]
- 47
Add DataReady
Tags: [Hidden, ReadOnly, NotReplicated, Deprecated]
The DevComputerCameraMode property determines the manner in which a player
moves their camera when using a device with a mouse and keyboard. See
DevComputerCameraMovementMode for a description of each camera
control mode available. This property cannot be set using a
LocalScript (it must be set on the server using a Script).
The default value of this property is determined by
StarterPlayer.DevComputerCameraMovementMode.
The word "Computer" in this property name refers to
non-TouchEnabled,
non-GamepadEnabled devices.
When set to UserChoice, a player can choose between any control mode
(except Scriptable) in the Roblox game settings. In general, it's a
good idea to allow players to choose their control mode to maximize
accessibility.
It's possible to create a custom control scheme by setting this property
to Scriptable.
This property doesn't affect players using a touch enabled device. See
Player.DevTouchCameraMode instead.
History 7
The DevComputerMovementMode property determines the manner in which a
player moves their character when using a device with a mouse and
keyboard. See DevComputerMovementMode for a description of each
movement control mode available. This property cannot be set using a
LocalScript (it must be set on the server using a Script).
The default value of this property is determined by
StarterPlayer.DevComputerMovementMode.
The word "Computer" in this property name refers to
non-TouchEnabled devices.
When set to UserChoice, a player can choose between any control mode
(except Scriptable) in the Roblox game settings. In general, it is a
good idea to allow players to choose their control mode to maximize
accessibility.
It's possible to create a custom control scheme by setting this property
to Scriptable.
This property doesn't affect players using a touch-enabled device. See
Player.DevTouchMovementMode instead.
History 7
This property determines if a player is able to toggle Mouse lock
by pressing Shift. A player can disable the mouse lock switch in
Roblox's game settings. By default, this property is set to the value of
StarterPlayer.EnableMouseLockOption. This can be set server-side
during run-time by using a Script. It can not be set client-side.
When mouse lock is enabled, the player's cursor is locked to the center of
the screen. Moving the mouse will orbit the camera around the player's
character, and the character will face the same
direction as the camera. It also offsets the camera view
just over the right shoulder of the player's character.
Note that shift-lock related APIs are in the process of being deprecated,
so it's recommended to use UserInputService.MouseBehavior instead
to lock the mouse.
History 9
The DevTouchCameraMode property determines the manner in which a player
moves their camera when using a
TouchEnabled device. See
DevTouchCameraMovementMode for a description of each camera control
mode available. This property cannot be set using a LocalScript
(it must be set on the server using a Script).
The default value of this property is determined by
StarterPlayer.DevTouchCameraMovementMode.
When set to UserChoice, a player can choose between any control mode
(except Scriptable) in the Roblox game settings. In general, it is a
good idea to allow players to choose their control mode to maximize
accessibility.
It's possible to create a custom control scheme by setting this property
to Scriptable.
This property doesn't affect players who aren't using a touch-enabled
device. See Player.DevComputerCameraMovementMode instead.
History 7
The DevTouchMovementMode property determines the manner in which a player
moves their character when using a
TouchEnabled device. See
DevTouchMovementMode for a description of each movement control
mode available. This property cannot be set using a LocalScript
(it must be set on the server using a Script).
The default value of this property is determined by
StarterPlayer.DevTouchMovementMode.
When set to UserChoice, a player can choose between any control mode
(except Scriptable) in the Roblox game settings. In general, it's a
good idea to allow players to choose their control mode to maximize
accessibility.
It's possible to create a custom control scheme by setting this property
to Scriptable.
This property doesn't affect players who aren't using a touch-enabled
device. See Player.DevComputerMovementMode instead.
History 7
The DisplayName
is a Player property that contains the display
name of the authenticated user associated with the Player object.
Unlike usernames, display names are non-unique names a player displays to
others. If the Roblox user has not chosen one, the property will read the
same as the Name
property.
Note:
- Since display names are non-unique, it's possible for two players in a
single instance to have identical names. If you need a globally unique
identifier for a player, use Player.UserId (which is static) or
Player.Name (which is the current Username) instead.
- Characters generated with Player.LoadCharacter or by the Roblox
engine will have their Humanoid.DisplayName property assigned to
the Player.DisplayName property.
- Display names may have unicode characters in the string. See
UTF-8 for more information on how to work with strings
with unicode characters.
History 6
The DistanceFromCharacter Player function returns the distance
between the character's head and the given Vector3 point. It
returns 0 if the player has no Player.Character.
This is useful when determining the distance between a player and another
object or location in game.
If you would like to determine the distance between two non-player
instances or positions, you can use the following:
1
| local distance = (position1 - position2).magnitude
|
History 2
The FollowUserId is a Player property that contains the
Player.UserId of the user that a player followed into the game. If
the player did not follow anyone into the game, this property will be 0.
This property is useful for alerting players who have been followed by
another player into the game.
You can get the name of the player followed using this user ID and the
Players:GetNameFromUserIdAsync() function.
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
History 6
Tags: [ReadOnly, NotReplicated]
It cannot be accessed by script code.
It is not meant to be used, and may have unresolved issues.
History 2
Tags: [Hidden, NotScriptable]
The GameplayPaused property indicates if the player is currently in a
pause state in a place with
StreamingEnabled activated. It is set
on the client but replicated to the server. To determine the pause status,
you can utilize this property.
See also:
History 8
Parameters (1) | Default |
---|
maxFriends | int | 200 |
Returns (1) |
---|
Array |
This function returns a dictionary array of online friends, limited by the
maxFriends
value. The function uses a 30 second cache.
In the returned array, some fields are only present for certain location
types. For example, PlaceId won't be present when LocationType is
0 (Mobile Website).
Name | Type | Description |
---|
VisitorId | number | The Player.UserId of the friend. |
UserName | string | The username of the friend. |
DisplayName | string | The Player.DisplayName of the friend. |
LastOnline | string | When the friend was last online. |
IsOnline | boolean | If the friend is currently online. |
LastLocation | string | The name of the friend's current location. |
PlaceId | number | The place ID of the friend's last location. |
GameId | string | The DataModel/JobId of the friend's last location. |
LocationType | number | The location type of the friend's last location:0 | Mobile Website | 1 | Mobile InGame | 2 | Webpage | 3 | Studio | 4 | InGame | 5 | Xbox | 6 | Team Create |
|
It will block the calling thread until completion.
History 4
Tags: [Yields]
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
string |
History 2
Returns a dictionary containing information describing how the Player
joins the experience. The dictionary contains any of the following fields:
Key | Value Type | Description |
---|
SourceGameId | number | The DataModel.GameId of the experience the Player teleported from. Only present if the player teleports to the current experience and if a server calls the teleport function. |
---|
SourcePlaceId | number | The DataModel.PlaceId of the place the Player teleported from. Only present if the player teleports to the current place and a server calls the teleport function. |
---|
ReferredByPlayerId | number | The Player.UserId of the player who invited the current player to the experience. Use this data to identify the referrer and trigger reward logic. |
---|
Members | array | An array containing the Player.UserId numbers of the users teleported alongside the Player . Only present if the player teleported as part of a group. |
---|
TeleportData | variant | Reflects the teleportData specified in the original teleport. Useful for sharing information between servers the player teleports to. Only present if teleportData was specified and a server calls the teleport function. |
---|
LaunchData | string | A plain or JSON encoded string that contains launch data specified in a deep link URL or
ExperienceInviteOptions.LaunchData. |
---|
GameJoinContext | dictionary | A dictionary that includes relevant information based on the context of the game join. It contains the following keys: |
---|
GetJoinData and TeleportData
If a server initiates the Player's teleport, the dictionary that this
method returns includes the player's teleport data. The
Player:GetJoinData() method can only be used to fetch teleport
data on the server. To fetch the data on the client, use
TeleportService:GetLocalPlayerTeleportData().
Unlike TeleportService:GetLocalPlayerTeleportData(),
Player:GetJoinData() only provides teleport data that meets the
following security criteria:
- It's guaranteed to have been sent by a Roblox server in the past 48
hours.
- It's guaranteed to have been sent with this Player.
- The
SourcePlaceId
and SourceGameId
are guaranteed to be the place
and universe the data was sent from. This means you can verify the
teleport data came from an approved place.
As this data is transmitted by the client, it can still potentially be
abused by an exploiter. Sensitive data such as player currency should be
transmitted via a secure solution like
Memory Stores.
It may behave in a non-standard way.
History 3
Tags: [CustomLuaState]
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
Mouse |
The GetMouse Player function returns the Mouse being used
by the client. The player's mouse instance can be used to track user mouse
input including left and right mouse button clicks and movement and
location.
The UserInputService service provides additional functions and
events to track user input - especially for devices that do not use a
mouse.
Note:
- This item must be used in a LocalScript to work as expected
online.
- Following an update in July 2014, the mouse's icon can now be set with
this method.
History 3
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
float |
GetNetworkPing returns the isolated network latency of the
Player in seconds. "Ping" is a measurement of the time taken for
data to be sent from the client to the server, then back again. It doesn't
involve data deserialization or processing.
For client-side LocalScripts, this function can only
be called on the Players.LocalPlayer. This function is useful in
identifying and debugging issues that occur in high network latency
scenarios. It's also useful for masking latency, such as adjusting the
speed of throwing animations for projectiles.
History 3
Parameters (1) |
---|
groupId | int64 |
Returns (1) |
---|
int |
The GetRankInGroup Player function returns the player's rank in
the group as an integer between 0 and 255, where 0 is a non-member and 255
is the group's owner.
Using this in a Script, as opposed to a LocalScript, will
not get you the most up-to-date information. If a player leaves a group
while they are in the game, GetRankInGroup will still think they're in
that group until they leave. However, this does not happen when used with
a LocalScript.
This is because the method caches results, so multiple calls of
GetRankInGroup on the same player with the same group ID will yield the
same result as when the method was first called with the given group ID.
The caching behavior is on a per-peer basis: a server does not share the
same cache as a client.
It will block the calling thread until completion.
History 3
Tags: [Yields]
The GetRoleInGroup Player function returns the player's role in
the group as a string, or Guest if the player isn't part of the group.
Using this in a Script, as opposed to a LocalScript, will
not get you the most up-to-date information. If a player leaves a group
while they are in the game, GetRoleInGroup will still think they're in
that group until they leave. However, this does not happen when used with
a LocalScript.
This is because the method caches results, so multiple calls of
GetRoleInGroup on the same player with the same group ID will yield the
same result as when the method was first called with the given group ID.
The caching behavior is on a per-peer basis: a server does not share the
same cache as a client.
It will block the calling thread until completion.
History 3
Tags: [Yields]
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
bool |
History 2
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
It is not meant to be used, and may have unresolved issues.
History 6
- 554
Change Default of Guest
from
false
to
- 553
Change Default of Guest
from
to
false
- 486
Change ThreadSafety of Guest
from
ReadOnly
to
ReadSafe
- 469
Change Tags of Guest
from
[ReadOnly, NotReplicated]
to
[Hidden, ReadOnly, NotReplicated]
- 462
Change ThreadSafety of Guest
from
to
ReadOnly
- 47
Add Guest
Tags: [Hidden, ReadOnly, NotReplicated]
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
bool |
The HasAppearanceLoaded Player function returns whether or not the
appearance of the player's Player.Character has loaded.
A player's appearance includes items such as the player's Shirt,
Pants, and Accessories.
This is useful when determining whether a player's appearance has loaded
after they first join the game, which can be tracked using the
Players.PlayerAdded event.
History 2
The HasVerifiedBadge Player property indicates if the player has a
Verified Badge.
History 1
This event fires approximately two minutes after the game engine
classifies the player as idle. Time is the number of
seconds that have elapsed since that point. The event continues to fire
every 30 seconds for as long as the player remains idle.
This event only fires in client scripts, not server scripts; use a
RemoteEvent to notify the server of idle players.
Roblox automatically disconnects players that have been idle for at least
20 minutes, so this event is useful for warning players that they will be
disconnected soon, disconnecting players prior to those 20 minutes, or
other away from keyboard (AFK) features.
To track how often automatic disconnects occur, try correlating this event
with occurrences of Players.PlayerRemoving.
History 2
InternalCharacterAppearanceLoaded
It cannot be accessed by script code.
It is not meant to be used, and may have unresolved issues.
History 2
Tags: [Hidden, NotScriptable]
This function was once used to return whether a player is best friends
with the specified user, but the best friend feature has since been
removed.
It exists only for backward compatibility, and should not be used for new work.
It will block the calling thread until completion.
History 4
Tags: [Yields, Deprecated]
This function sends a request to the Roblox website asking whether a
player is a friend of another user, given the Player.UserId of
that user. This function caches results so multiple calls of the function
on the same player with the same Player.UserId may not yield the
most up-to-date result. This does not happen when used in a
LocalScript.
It will block the calling thread until completion.
History 3
Tags: [Yields]
The IsInGroup Player function sends a request to the Roblox
website asking whether a player is a member of a group, given the ID of
that group.
Using this in a Script, as opposed to a LocalScript, will
not get you the most up-to-date information. If a player leaves a group
while they are in the game, IsInGroup will still think they're in that
group until they leave. However, this does not happen when used with a
LocalScript.
This is because the method caches results, so multiple calls of IsInGroup
on the same player with the same group ID will yield the same result as
when the method was first called with the given group ID. The caching
behavior is on a per-peer basis: a server does not share the same cache as
a client.
It will block the calling thread until completion.
History 3
Tags: [Yields]
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
bool |
Returns a boolean value indicating that player's verification status. When
true, the player is verified. Verification includes, but isn't limited to,
non-VOIP phone number or government ID verification.
When implementing IsVerified
, exercise caution to ensure that the
implementation does not inadvertently block all unverified users.
Note that the method can only be called on the backend server. Calling it
client-side results in an error. Additionally, this method will always
return false
in Studio.
History 1
The Kick() method allows an experience to gracefully
disconnect a client and optionally provide a message to the disconnected
user. This is useful for moderating abusive users. You should only allow
specific users whom you trust to trigger this method on other users.
Calling this method on a Player with no arguments disconnects the
user from the server and provides a default notice message. Calling this
method on a Player along with a string as the first argument
replaces the default message with the provided string.
When using this method from a LocalScript, only the local user's
client can be kicked.
History 4
Parameters (0) |
---|
No parameters. |
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
This function returns a boolean value that was previously saved to the
player with Player:SaveBoolean() with the same key. Returns false
if the key doesn't exist, not nil.
It exists only for backward compatibility, and should not be used for new work.
History 3
Tags: [Deprecated]
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
null |
The LoadCharacter Player function creates a new character for the
player, removing the old one. It also clears the player's Backpack
and PlayerGui.
This is useful in cases where you want to reload the character without
killing the player, such as when you want to load a new character
appearance after changing the player's Player.CharacterAppearance.
Note: The function is similar to Player:LoadCharacterBlocking(),
but the request is processed asynchronously instead of synchronously. This
means other tasks will be able to continue while the character is being
loaded, including the rendering of the game and any other tasks. Also,
this function can be used in a script, while LoadCharacterBlocking cannot.
After calling LoadCharacter for an individual player, it is not
recommended to call it again for the same player until after that player's
Player.CharacterAppearanceLoaded event has fired.
Character Loading Event order
Calling the Player:LoadCharacter() with an R15 Avatar fires events
in the following order (Note: R6 ordering is different):
- Player.Character sets
- Player.CharacterAdded fires
- Player.Changed fires with a value of "Character"
- Character appearance initializes
- Player.CharacterAppearanceLoaded fires
- Character.Parent sets to the DataModel
- The Character rig builds, and the Character scales
- Character moves to the spawn location
- LoadCharacter returns
It will block the calling thread until completion.
History 6
Tags: [Yields]
The LoadCharacterAppearance Player function places the given
instance either in the player's Player.Character, head, or
StarterGear based on the instance's class.
This is useful when giving a player's character an asset from the Roblox
catalog, such as a hat or piece of gear.
It is similar to Player:LoadCharacter(), except it does not reload
the entire character instance, StarterGear, or PlayerGui.
Note:
- Accessory, Shirt, ShirtGraphic,
CharacterMesh, BodyColors, and Accoutrement are
parented to the player's character.
- Decal, FileMesh, SpecialMesh, BlockMesh,
CylinderMesh, and Texture are parented to the
character's head.
- Tool is parented to the player's StarterGear.
- All other classes are ignored.
It exists only for backward compatibility, and should not be used for new work.
History 4
Tags: [Deprecated]
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
null |
It will block the calling thread until completion.
History 3
Tags: [Yields]
LoadCharacterWithHumanoidDescription
This function spawns an avatar so it has everything equipped in the passed
in HumanoidDescription.
After calling LoadCharacterWithHumanoidDescription for an individual
player, it is not recommended to call the function again for the same
player until after that player's Player.CharacterAppearanceLoaded
event has fired.
See also:
- HumanoidDescription System,
an article which explains the humanoid description system in greater
detail and provides several scripting examples
It will block the calling thread until completion.
History 4
Tags: [Yields]
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
null |
It exists only for backward compatibility, and should not be used for new work.
History 4
Tags: [Deprecated]
This function returns an instance that was previously saved to the player
with Player:SaveInstance() with the same key. Returns nil if the
key doesn't exist.
It exists only for backward compatibility, and should not be used for new work.
History 3
Tags: [Deprecated]
This function was once used by an ancient data persistence method to
return a number value that was previously saved to the player with
Player:SaveNumber() with the same key. Returns 0 if the key
doesn't exist, not nil.
It exists only for backward compatibility, and should not be used for new work.
History 4
Tags: [Deprecated]
This function returns a string value that was previously saved to the
player with Player:SaveString() with the same key. Returns an
empty string ("") if the key doesn't exist, not nil..
It exists only for backward compatibility, and should not be used for new work.
History 3
Tags: [Deprecated]
The LocaleId Player property shows the locale id that the local
player has set for their Roblox account. It holds a string with the two
letter code (for example, "en-us") for the locale.
This can be used to determine the geographic demographic of your game's
player base, and is also the locale that will be used for automatic
localization (see GuiBase2d.AutoLocalize) of in-experience
content. This property allows access to the player's locale from the
server.
See also LocalizationService.RobloxLocaleId, the locale ID used
for localizing internal content. This will be a different value when
Roblox does not yet internally support the local player's set locale.
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
It is not meant to be used, and may have unresolved issues.
History 4
Tags: [Hidden, ReadOnly, NotReplicated]
It cannot be accessed by script code.
It is not meant to be used, and may have unresolved issues.
History 4
Tags: [Hidden, NotScriptable]
Its interface does not cross the network boundary.
It is not meant to be used, and may have unresolved issues.
History 7
Tags: [Hidden, NotReplicated]
This property can only be read from to determine membership (it cannot be
set to another membership type). It holds a MembershipType enum of
the account's membership type.
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
History 5
Tags: [ReadOnly, NotReplicated]
It cannot be accessed by script code.
It is not meant to be used, and may have unresolved issues.
History 2
Tags: [Hidden, NotScriptable]
Parameters (2) | Default |
---|
walkDirection | Vector3 | |
relativeToCamera | bool | false |
Returns (1) |
---|
null |
The Move Player function causes the player's character to walk in
the given direction until stopped, or interrupted by the player (by using
their controls).
This is useful when scripting NPC Humanoids that move
around a map - but are not controlled by an actual player's input.
Note that the function's second argument indicates whether the provided
Vector3 should move the player relative to world coordinates
(false) or the player's Camera (true).
History 3
The Neutral property determines whether the player is on a specific team.
- When true, the player is not on a specific team. This also means that
the Player.Team property will be nil and the
Player.TeamColor will be white.
- When false, the player is on a specific team. The Player.Team
property will correspond to the Team that the player is on, as
will the Player.TeamColor.
History 5
Fired when the TeleportState of a player changes. This event is useful for
detecting whether a teleportation was successful.
What is the TeleportState?
When a teleportation request is made using TeleportService, there
are a series of stages before the Player is teleported. The
current stage is represented by the TeleportState value which is
given by OnTeleport. See below for a practical example of this.
History 3
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
PlayerChatTranslationSettingsLocaleSetFromLua
Parameters (1) |
---|
newLocaleId | string |
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
PlayerExperienceSettingsLocaleSetFromLua
Parameters (1) |
---|
newLocaleId | string |
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
It cannot be accessed by script code.
It is not meant to be used, and may have unresolved issues.
History 2
Tags: [Hidden, NotScriptable]
RemoteFriendRequestSignal
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
null |
History 3
The ReplicationFocus Player property sets the part to focus
replication around a Player. Different Roblox systems that communicate
over the network (such as physics, streaming, etc) replicate at different
rates depending on how close objects are to the replication focus.
When this property is nil, it reverts to its default behavior which is to
treat the local player's character's PrimaryPart
as the replication focus.
This property should only be set on the server with a Script, not
a LocalScript. Note that this property does not change or update
network ownership of parts.
History 6
For experiences where instance
streaming is enabled, requests that the
server stream to the player regions (parts and terrain) around the
specified X, Y, Z location in the 3D world. It is useful if
the experience knows that the player's CFrame will be set to
the specified location in the near future. Without providing the location
with this call, the player may not have streamed in content for the
destination, resulting in a streaming pause or other undesirable behavior.
The effect of this call will be temporary and there are no guarantees of
what will be streamed in around the specified location. Client memory
limits and network conditions may impact what will be available on the
client.
Usage Precaution
Requesting streaming around an area is not a guarantee that the
content will be present when the request completes, as streaming is
affected by the client's network bandwidth, memory limitations, and other
factors.
It will block the calling thread until completion.
History 5
Tags: [Yields]
If set, the player will respawn at the given SpawnLocation. This
property can only be set through Lua and must contain a reference to a
valid SpawnLocation, which must meet the following criteria:
If RespawnLocation is not set to a valid SpawnLocation then the
default spawning logic will apply. For more information on this see the
page for SpawnLocation.
Alternatives to RespawnLocation
History 6
This function is used to save a boolean value that can be loaded again at
a later time using Player:LoadBoolean().
It exists only for backward compatibility, and should not be used for new work.
History 4
Tags: [Deprecated]
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
null |
It exists only for backward compatibility, and should not be used for new work.
History 4
Tags: [Deprecated]
This function was once used by an ancient data persistence method to save
an instance which can be loaded again at a later time using
Player:LoadInstance()..
It exists only for backward compatibility, and should not be used for new work.
History 4
Tags: [Deprecated]
This function was once used by an ancient data persistence method to save
a number value that can be loaded again at a later time using
Player:LoadNumber().
It exists only for backward compatibility, and should not be used for new work.
History 5
Tags: [Deprecated]
This function was once used by an ancient data persistence method to save
a string value that can be loaded again at a later time using
Player:LoadString().
It exists only for backward compatibility, and should not be used for new work.
History 4
Tags: [Deprecated]
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
ServerToClientUnfilteredChatReplicate
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
Parameters (1) |
---|
accountAge | int |
Returns (1) |
---|
null |
The SetAccountAge function sets the Player.AccountAge of the
player in days.
It is used to set the Player property that describes how long ago
a player's account was registered in days.
This does not set the age of the player on the account, but the age of the
account itself relative to when it was first created.
History 4
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
null |
History 1
SetCharacterAppearanceJson
History 2
SetChatTranslationSettingsLocaleId
History 1
SetExperienceSettingsLocaleId
History 2
Parameters (1) |
---|
moderationAccessKey | string |
Returns (1) |
---|
null |
History 2
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
This method sets whether or not the player sees chat filtered by
TextService:FilterStringAsync() rather than normal chats.
1
2
3
4
| local Players = game:GetService("Players")
local player = Players.LocalPlayer
player:SetSuperSafeChat(true)
|
Regardless of whether a player has filtered chat enabled, all chat should
be filtered by TextService when broadcast to other players or on
the player's own screen. TextService:FilterStringAsync() returns a
TextFilterResult object that can be filtered differently according
to the message's intended use.
History 4
It exists only for backward compatibility, and should not be used for new work.
History 4
Tags: [Deprecated]
It is not meant to be used, and may have unresolved issues.
History 6
Tags: [Hidden]
Parameters (1) |
---|
radius | float |
History 2
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden]
It cannot be accessed by script code.
It is not meant to be used, and may have unresolved issues.
History 2
Tags: [Hidden, NotScriptable]
The Team property is a reference to a Team object within the
Teams service. It determines the team the player is on; if the
Player isn't on a team or has an invalid Player.TeamColor,
this property is nil. When this property is set, the player has joined the
Team and the Team.PlayerAdded event fires on the
associated team. Similarly, Team.PlayerRemoved fires when the
property is unset from a certain Team.
Its interface does not cross the network boundary.
History 6
Tags: [NotReplicated]
The TeamColor property determines which team a Player is associated with
according to that Team's Team.TeamColor. Changing this property
will change Player.Team according to whichever team has the same
BrickColor for their Team.TeamColor. If no Team object
has the associated TeamColor, the player will not be associated with a
team.
It's often a better idea to set Player.Team to the respective
Team instead of using this property. Setting this property often
leads to repetition of the same BrickColor value for a certain team across
many scripts; this is something you want to avoid when adhering to the
"Don't Repeat Yourself" (DRY) principle.
History 5
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
It is not meant to be used, and may have unresolved issues.
History 5
Tags: [Hidden, ReadOnly, NotReplicated]
It is not meant to be used, and may have unresolved issues.
History 6
Tags: [Hidden]
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
It is not meant to be used, and may have unresolved issues.
History 3
Tags: [Hidden, ReadOnly, NotReplicated]
The UserId is a Player property that contains a read-only integer
that uniquely and consistently identifies every user account on
Roblox. Unlike the Instance.Name of a Player, which may change
according the user's present username, this value will never change for
the same account.
This property is essential when saving/loading player data using
GlobalDataStores. Use a player's UserId as the
data store key so that each player has a unique key.
History 6
It is not meant to be used, and may have unresolved issues.
History 5
Tags: [Hidden]
Its interface does not cross the network boundary.
It is not meant to be used, and may have unresolved issues.
History 1
Tags: [Hidden, NotReplicated]
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
bool |
This function is used to pause the script until the player's data is
available to manipulate, or until a certain amount of time has elapsed
without fetching the player's data
It exists only for backward compatibility, and should not be used for new work.
It will block the calling thread until completion.
History 3
Tags: [Yields, Deprecated]
It exists only for backward compatibility, and should not be used for new work.
IsFriendsWith should be used instead.
It will block the calling thread until completion.
History 4
Tags: [Yields, Deprecated]
It exists only for backward compatibility, and should not be used for new work.
LoadBoolean should be used instead.
History 3
Tags: [Deprecated]
It exists only for backward compatibility, and should not be used for new work.
LoadInstance should be used instead.
History 3
Tags: [Deprecated]
It exists only for backward compatibility, and should not be used for new work.
LoadNumber should be used instead.
History 4
Tags: [Deprecated]
It exists only for backward compatibility, and should not be used for new work.
LoadString should be used instead.
History 3
Tags: [Deprecated]
It exists only for backward compatibility, and should not be used for new work.
SaveBoolean should be used instead.
History 4
Tags: [Deprecated]
It exists only for backward compatibility, and should not be used for new work.
SaveInstance should be used instead.
History 4
Tags: [Deprecated]
It exists only for backward compatibility, and should not be used for new work.
SaveNumber should be used instead.
History 4
Tags: [Deprecated]
It exists only for backward compatibility, and should not be used for new work.
SaveString should be used instead.
History 4
Tags: [Deprecated]
It exists only for backward compatibility, and should not be used for new work.
UserId should be used instead.
History 8
Tags: [Deprecated]
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
bool |
It exists only for backward compatibility, and should not be used for new work.
WaitForDataReady should be used instead.
It will block the calling thread until completion.
History 3
Tags: [Yields, Deprecated]