Skip to main content

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 NameReturn TypeParametersDescription
IsExtraneousObjectPresentboolstringReturns a true if an extraneous object with the given key is present on the Player
GetExtraneousObjectKeysstring[]noneReturns all extraneous object keys
GetExtraneousObjectobjectstringReturns an extraneous object from its key
AddExtraneousObjectvoidstring, objectAdds an extraneous object to the Player
RemoveExtraneousObjectvoidstringRemoves an extraneous object by key
GetPlayerAssignedTagsstring[]noneReturns all Player assigned tags
AddPlayerAssignedTagvoidstringAdds a tag to the Player
RemovePlayerAssignedTagvoidstringRemoves a tag from the Player
RespawnvoidnoneRespawns the Player
TeleportTovoidfloat3Teleports the Player to world position coordinates
Rotatevoidfloat4Rotates the root of a Player
SetAvatarvoidstringSets the avatar to a specific avatar id

Properties

Property NameTypeDescription
AvatarAvatarThe Avatar associated with the Player
PronounsPronounsThe Player's pronouns
UsernamestringThe Player's username
DisplayNamestringThe Player's DisplayName, or Username if empty
IsHostboolReturns true if the Player is the Host of the GameInstance