Player
info
- This class is only available on LocalAvatarScripts and LocalScripts
The Player class is the representation of a Player connected to a GameInstance. It includes all NetPlayers of a GameInstance and even the LocalPlayer. The Player class of a player can even be accessed if you are not in an instance at all; however, it will restrict the access to only the LocalPlayer.
Methods
Method Name | Return Type | Parameters | Description |
---|---|---|---|
IsExtraneousObjectPresent | bool | string | Returns a true if an extraneous object with the given key is present on the Player |
GetExtraneousObjectKeys | string [] | none | Returns all extraneous object keys |
GetExtraneousObject | object | string | Returns an extraneous object from its key |
AddExtraneousObject | void | string , object | Adds an extraneous object to the Player |
RemoveExtraneousObject | void | string | Removes an extraneous object by key |
GetPlayerAssignedTags | string [] | none | Returns all Player assigned tags |
AddPlayerAssignedTag | void | string | Adds a tag to the Player |
RemovePlayerAssignedTag | void | string | Removes a tag from the Player |
Respawn | void | none | Respawns the Player |
TeleportTo | void | float3 | Teleports the Player to world position coordinates |
Rotate | void | float4 | Rotates the root of a Player |
SetAvatar | void | string | Sets the avatar to a specific avatar id |
Properties
Property Name | Type | Description |
---|---|---|
Avatar | Avatar | The Avatar associated with the Player |
Pronouns | Pronouns | The Player's pronouns |
Username | string | The Player's username |
DisplayName | string | The Player's DisplayName, or Username if empty |
IsHost | bool | Returns true if the Player is the Host of the GameInstance |