Dice
constDice:object
Defined in: server/api.d.ts:3026
Dice matches between two players on the game’s own dice table.
Both players sit down at the dice table nearest them and play it as they would against an NPC, the other player’s body opposite. Every throw is dealt and every move checked by the server, by the game’s own scoring rules; badges and dice perks are off, so a match is decided by the dice and the decisions alone.
Type Declaration
Section titled “Type Declaration”matchOf()
Section titled “matchOf()”matchOf(
player):number
The match a player is in.
Parameters
Section titled “Parameters”player
Section titled “player”number
NetworkID of the player to ask about.
Returns
Section titled “Returns”number
The match id, or 0.
setNames()
Section titled “setNames()”setNames(
match,first,second):boolean
Changes both scoreboard labels on the next native scoreboard refresh. Empty restores a native label. Names allow at most 64 UTF-8 bytes and no control characters.
Parameters
Section titled “Parameters”number
Match ID.
string
First seat label.
second
Section titled “second”string
Second seat label.
Returns
Section titled “Returns”boolean
False if the match has ended.
start()
Section titled “start()”start(
first,second,options?):number
Starts a match. Both players must stand together, within a few metres, at a dice table, and neither may be playing already. Throws an Error saying why when it cannot start.
Parameters
Section titled “Parameters”number
NetworkID of the player on the table’s first seat.
second
Section titled “second”number
NetworkID of the player on the second seat.
options?
Section titled “options?”The target score. Optional.
Returns
Section titled “Returns”number
The match id.
stop()
Section titled “stop()”stop(
match):boolean
Ends a match with nobody winning; both tables close.
Parameters
Section titled “Parameters”number
The match to end.
Returns
Section titled “Returns”boolean
False when it had already ended.
tables()
Section titled “tables()”tables():
DiceTableInfo[]
Lists the current level’s dice tables and their seats. The same placements exist in every virtual world; readiness and occupancy belong to the gamemode.
Returns
Section titled “Returns”The level’s tables, in GUID order.