Skip to content

Player Instance

Player instances can be retrieved from the Player Manager and are also frequently passed to callbacks.

Member Variables

Variable Type Description
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.
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

Function Name Return Description  
attachCameraToObject( parameters) Makes a Player's camera follow an Object.
broadcast( message, message_color) Print message on Player's screen and their game chat log.
changeColor( player_color) Changes player to this Player Color.
clearSelectedObjects()
clearSelectedObjects()
Clears a player's current selection.
getHandCount()
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()
getHoldingObjects()
Objects a Player is holding in their hand.
getHoverObject()
getHoverObject()
Object that the Player's pointer is hovering over.
getPointerPosition()
getPointerPosition()
Player's pointer coordinates.
getPointerRotation()
getPointerRotation()
Player's pointer rotation on Y axis.
getSelectedObjects()
getSelectedObjects()
Objects that the Player has selected with an area selection.
kick()
kick()
Kicks Player out of the room.
lookAt( parameters) Moves a Player's camera, forcing 3'rd person camera mode.
mute()
mute()
Mutes or unmutes Player, preventing/allowing voice chat.
pingTable(
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()
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.
setUITheme( theme) Sets the UI theme for the player.

Function Details

attachCameraToObject(...)

Makes a Player's camera follow an Object.

attachCameraToObject(parameters)

  • parameters: A Table with parameters which guide the function.
    • parameters.object: The Object to attach the camera to.
    • parameters.offset: A Vector to offset the camera by.
      • Optional, defaults to {x=0, y=0, z=0}.
self.attachCameraToObject({object=self})

broadcast(...)

Print message on Player's screen and their game chat log.

broadcast(message, message_color)

  • message: The message to be displayed.
  • message_color: Tint of the message text.
    • Optional, defaults to {r=1, g=1, b=1}.

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)

  • hand_index: An index, representing which hand zone to return Objects for.
    • Optional, defaults to 1.

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)

  • hand_index: An index, representing which hand zone to return data on.
    • Optional, defaults to 1.

Return Data Table

  • data: The Table the data is returned in.
    • data.position: Position of the hand zone.
    • data.rotation: Rotation of the hand zone.
    • data.scale: Scale of the hand zone.
    • data.forward: Forward direction of the hand zone.
    • data.right: Right direction of the hand zone.
    • data.up: Up direction of the hand zone.

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. 0 to 360.
      • 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)

  • message: The text to be displayed.
  • message_color: Color for the message text to be tinted.
    • Optional, defaults to {r=1, g=1, b=1}.

setCameraMode(...)

Sets the player's camera mode. Camera modes available: "ThirdPerson", "FirstPerson", "TopDown".

changeColor(camera_mode)

  • camera_mode: The Camera Mode to set the Player's Camera to.
Player["White"].setCameraMode("FirstPerson")

setHandTransform(...)

Sets transform elements of a hand zone.

setHandTransform(parameters, hand_index)

  • parameters: The Table of data to transform the hand zone with.
    • parameters.position: Position of the hand zone.
      • Optional, defaults to {x=0, y=0, z=0}.
    • parameters.rotation: Rotation of the hand zone.
      • Optional, defaults to {x=0, y=0, z=0}.
    • parameters.scale: Scale of the hand zone.
      • Optional, defaults to {x=0, y=0, z=0}.
  • hand_index: Index, representing which hand zone to modify.
    • Optional, defaults to 1.

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)

setUITheme(...)

Sets the UI theme for the player.

setUITheme(theme)

  • theme: A string representing a theme.

Theme Format

You can view the expected theme format by in-game going to Menu -> Configuration -> Interface -> Theme. Select a theme then press "Import/Export".

Example

Set the White player's default button background to pink.

Player.white.setUITheme("button_normal #FFC0C0")