Player
Player, a static global class, allows control over in-game players and their hand zones.
Example Usage: Player["White"].seated
or Player["Green"].mute()
Member Variables
Like Object member variables, Player has its own member variables.
Variable | Description | Type |
---|---|---|
admin | If the player is promoted or the host of the game. Read only. | |
blindfolded | If the player is blindfolded. | |
color | The player's Player Color. Read only. | |
host | If the player is the host. Read only. | |
lift_height | The lift height for the player. This is how far an object is raised when held in a player's hand. Value is ranged 0 to 1. | |
promoted | If the current player is promoted. | |
seated | If a player is currently seated at this color. Read only. | |
steam_id | The Steam ID of the player. This is unique to each player's Steam account. Read only. | |
steam_name | The Steam name of the player. Read only. | |
team | The team of the player. Options: "None", "Clubs", "Diamonds", "Hearts", "Spades", "Jokers" . |
Function Summary
Class Functions
Function Name | Description | Return | |
---|---|---|---|
attachCameraToObject( parameters) | Makes a Player's camera follow an Object. | ||
broadcast( message, Color) | Print message on Player's screen and their game chat log. | ||
changeColor( player_color) | Changes player to this Player Color. | ||
getHandCount() | Number of hand zones owned by this color. | ||
getHandObjects( hand_index) | Objects that are in this hand zone. | ||
getHandTransform( hand_index) | Returns a Table of data on this hand zone. | ||
getHoldingObjects() | Objects a Player is holding in their hand. | ||
getHoverObject() | Object that the Player's pointer is hovering over. | ||
getPointerPosition() | Player's pointer coordinates. | ||
getPointerRotation() | Player's pointer rotation on Y axis. | ||
getSelectedObjects() | Objects that the Player has selected with an area selection. | ||
clearSelectedObjects() | Clears a player's current selection. | ||
kick() | Kicks Player out of the room. | ||
lookAt( parameters) | Moves a Player's camera, forcing 3'rd person camera mode. | ||
mute() | Mutes or unmutes Player, preventing/allowing voice chat. | ||
pingTable( position) | Emulates the player using the ping tool at the given position (tapping Tab). | ||
print( message, message_color) | Prints a message into the Player's game chat. | ||
promote() | Promotes/demotes a Player. Promoted players have access to most host privileges. | ||
setCameraMode( camera_mode) | Sets the player's camera mode. Camera modes available: "ThirdPerson", "FirstPerson", "TopDown". | ||
setHandTransform( parameters, hand_index) | Sets transform elements of a hand zone. |
Direct Class Functions
These functions return direct references to Players, not a Player Color. See details section for usage.
Function Details
Class Function Details
attachCameraToObject(...)
Makes a Player's camera follow an Object.
attachCameraToObject(parameters)
self.attachCameraToObject({object=self})
broadcast(...)
Print message on Player's screen and their game chat log.
broadcast(message, message_color)
changeColor(...)
Changes player to this Player Color (seat).
changeColor(player_color)
- player_color: The Player Color seat to move the Player to.
Player["White"].changeColor("Red")
getHandObjects(...)
Returns a Table of Objects that are in this hand zone.
getHandObjects(hand_index)
Indexing
Hand indexes start at 1 and are numbered in the order of their creation. Each Player color has its own indexes.
getHandTransform(...)
Returns a Table of data on this hand zone.
getHandTransform(hand_index)
Return Data Table
Indexing
Hand indexes start at 1 and are numbered in the order of their creation. Each Player color has its own indexes.
lookAt(...)
Moves a Player's camera, forcing 3'rd person camera mode.
lookAt(parameters)
- parameters: A Table of controlling parameters to point the player camera.
- parameters.position: Position to center the camera on.
- parameters.pitch: Pitch angle of the camera. 0 to 90.
- Optional, defaults to 0.
- parameters.yaw: Yaw angle of the camera. -180 to 180.
- Optional, defaults to 0.
- parameters.distance: Distance the camera is from the position Vector.
- Optional, defaults to 40.
-- Assuming someone is in the White seat Player["White"].lookAt({ position = {x=0,y=0,z=0}, pitch = 25, yaw = 180, distance = 20, })
print(...)
Prints a message into the Player's game chat.
print(message, message_color)
setHandTransform(...)
Sets transform elements of a hand zone.
setHandTransform(parameters, hand_index)
Indexing
Hand indexes start at 1 and are numbered in the order of their creation. Each Player color has its own indexes.
-- Example of moving/rotating/scaling hand zone params = { position = {x=0, y=5, z=0}, rotation = {x=0, y=45, z=0}, scale = {x=2, y=2, z=2}, } Player["White"].setHandTransform(params, 2)
setCameraMode(...)
Sets the player's camera mode. Camera modes available: "ThirdPerson", "FirstPerson", "TopDown".
Player["White"].setCameraMode("FirstPerson")
Direct Class Function Details
getPlayers()
Returns Table of all Players in the instance.
-- Blindfolding all players playerList = Player.getPlayers() for _, playerReference in ipairs(playerList) do playerReference.blindfolded = true end
getSpectators()
Returns Table of all Players in spectator (Grey).
-- Printing steam name of all players to host chat playerList = Player.getSpectators() for _, playerReference in ipairs(playerList) do print(playerReference.steam_name) end