Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Global objectServer APIGenerated

Dice

const Dice: 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.

matchOf(player): number

The match a player is in.

number

NetworkID of the player to ask about.

number

The match id, or 0.

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.

number

Match ID.

string

First seat label.

string

Second seat label.

boolean

False if the match has ended.

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.

number

NetworkID of the player on the table’s first seat.

number

NetworkID of the player on the second seat.

DiceMatchOptions

The target score. Optional.

number

The match id.

stop(match): boolean

Ends a match with nobody winning; both tables close.

number

The match to end.

boolean

False when it had already ended.

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.

DiceTableInfo[]

The level’s tables, in GUID order.