YaPlayerComponent¶
YaPlayerComponent manages player-related information.Functions¶
number GetId()¶
ReturnsThe player ID
Returns the ID of the player.
string GetName()¶
ReturnsThe name of the player
Returns the name of the player.
YaCharacterComponent GetCharacter()¶
ReturnsThe character component of the player
Returns the character component of the player.
YaEntity GetCharacterEntity()¶
ReturnsThe player's character entity
Returns the player's character entity.
boolean HasCharacter()¶
Returnstrue if the player has an character
Checks if the player has an character.
table GetPlayerProperty(string key)¶
SERVER ONLY
Returnsnull if the key does not exist.
Retrieves the property of the player.
keyThe property key
boolean SetPlayerStringProperty(string key, string value)¶
SERVER ONLY
Returnstrue if a new property is created.
Sets the player's property with the String value.
The String value can contains as many as 4096 characters.
keyThe property keyvalueThe String value of the property
boolean SetPlayerNumberProperty(string key, number value)¶
SERVER ONLY
Returnstrue if a new property is created.
Sets the player property with the Double value.
keyThe property keyvalueThe Number value of the property
boolean RemovePlayerProperty(string key)¶
SERVER ONLY
Returnsfalse if the player property does not exist.
Removes the player property with the given key.
keyThe property key
Array<string> GetPlayerPropertyKeys()¶
SERVER ONLY
ReturnsA list of the player's property keys
Gets a list of the player's property keys.
Events¶
SpawnedEvent<number, YaEntity, YaEntity>¶
Fired when a player's character spawns
playerIdThe unique identifier of the playerspawnPointEntityThe spawn point entitycharacterEntityThe spawned character entity
1 2 3 4 5 6 7 8 9 10 11 12 | |