Player
A userdata object representing a player in the game.
Values:
-
character[ Character ]Get: Returns the character the player is controlling.
-
Get: (Client-Only) Returns client public data from a player.Set: (Client-Only) Sets client public data on a player.
-
Get: Returns the id of a player.
-
Get: Returns the name of a player.
-
Get: (Server-Only) Returns (server) public data from a player.Set: (Server-Only) Sets (server) public data on a player.
Operations:
| Operation | Returns | Description |
|---|---|---|
Player == Player |
boolean | Checks if two instances of Player refer to the same Player. |
Server + Client
getCarry
player:getCarry( )
Returns the carry container of the player.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
Returns:
| Type | Description |
|---|---|
| Container | The player's carry. |
getCharacter
player:getCharacter( )
Returns the character the player is controlling.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
Returns:
| Type | Description |
|---|---|
| Character | The player's character. |
getCurrentToolUuid
player:getCurrentToolUuid( player )
Returns the uuid of the tool the player is currently holding.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Uuid | The player. |
Returns:
| Type | Description |
|---|---|
| Tool | The player's held tool uuid. |
getHotbar
player:getHotbar( )
Returns the hotbar container of the player.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
Returns:
| Type | Description |
|---|---|
| Container | The player's hotbar. |
getId
player:getId( )
Returns the id of a player.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
Returns:
| Type | Description |
|---|---|
| integer | The player's id. |
getInventory
player:getInventory( )
Returns the inventory container of the player.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
Returns:
| Type | Description |
|---|---|
| Container | The player's inventory. |
getName
player:getName( )
Returns the name of a player.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
Returns:
| Type | Description |
|---|---|
| string | The player's name. |
isActive
player:isActive( )
Returns true if the player is currently in the game.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
Returns:
| Type | Description |
|---|---|
| boolean | True if active. |
isFemale
player:isFemale( )
Check if the player is female
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player |
Returns:
| Type | Description |
|---|---|
| boolean | True if female |
isMale
player:isMale( )
Check if the player is male
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player |
Returns:
| Type | Description |
|---|---|
| boolean | True if male |
Server-only
getCarryColor
player:getCarryColor( )
Returns the color of the shape the player is carrying.
Returns:
| Type | Description |
|---|---|
| Color | The color of the shape the player is carrying. |
getCarryData
player:getCarryData( )
Get the carry data on a player.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
Returns:
| Type | Description |
|---|---|
| table | The carry data. |
getCustomizationUuid
player:getCustomizationUuid( categoryIndex )
Get uuid of customization from index
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
categoryIndex |
integer | The index of the customization category to get the uuid for. |
Returns:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | — |
getPublicData
player:getPublicData( )
Returns (server) public data from a player.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
Returns:
| Type | Description |
|---|---|
| table | The public data. |
placeLift
player:placeLift( creation, position, level, rotation )
Place down a lift game object
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player to own the lift. |
creation |
table | The bodies to place on the lift. {Body, ..} |
position |
Vec3 | The lift position. |
level |
integer | The lift level. |
rotation |
integer | The rotation of the creation on the lift. |
removeLift
player:removeLift( )
Remove the player's lift, if the lift exists.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player that owns the lift. |
sendCharacterEvent
player:sendCharacterEvent( event )
Sends an event to a given player
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player to send to |
event |
string | The event to send |
setCarryData
player:setCarryData( data )
Set the carry data on a player.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
data |
table | The carry data. |
setCharacter
player:setCharacter( character )
Sets the character the player is controlling.
Parameters:
setPublicData
player:setPublicData( data )
Sets (server) public data on a player.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
data |
table | The public data. |
Client-only
getClientPublicData
player:getClientPublicData( )
Returns client public data from a player.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
Returns:
| Type | Description |
|---|---|
| table | The client public data. |
setClientPublicData
player:setClientPublicData( data )
Sets client public data on a player.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
Player | The player. |
data |
table | The client public data. |