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.
key
The 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.
key
The property keyvalue
The 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.
key
The property keyvalue
The 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.
key
The 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
playerId
The unique identifier of the playerspawnPointEntity
The spawn point entitycharacterEntity
The spawned character entity
1 2 3 4 5 6 7 8 9 10 11 12 |
|