Dice
Dice matches at the game's dice tables, on the game's dice screen. The server makes each throw and checks each move by the game's scoring, with dice perks off. Players can use the game's dice kinds and badges. A match ends when a banked score reaches the target, or with gaveUp, left, timedOut (3 minutes without a move), failed or stopped. Players within 20 m can watch. A player can first take one of a table's two chairs to wait with Dice.sit, and a match between those two plays from their chairs, leaving them seated. Events are diceTableUse(player, table, match), diceMatchStart, diceTurnStart, diceMove, diceTurnEnd, and diceMatchEnd(match, first, second, winner, reason, firstScore, secondScore), where winner is 0, 1, or 255 for nobody.
dice.tables()
Dice.tables()The tables in the server's level, each { id, behavior, level, position, seats, chairs, placed }, where `placed` is false for the level's own. `chairs` gives each chair's { position, player, sitFrom }. `player` is the holder's id or null. `sitFrom`, { position, yaw in degrees }, is where the game's sit-down begins, so a script can walk an NPC there and have it sit without a jump. A table placed by a script has an empty list. Tables SmartObject.remove took from all dimensions are not listed.
dice.start()
Dice.start(first, second, options)Starts a match between two players within 4 m of each other at a table, or on the two chairs of one table, where each plays from their chair. Returns the match id, and throws if they are not at a table or one is already playing.
dice.startAgainstNpc()
Dice.startAgainstNpc(player, options)Starts a match between a player and an opponent run by the server, at the table where the player stands or sits. The server makes each throw and plays the opponent's turns at the chosen difficulty, and the player's game shows them like another player's. The body is the given Npc, or a stand-in the server seats on the free chair. diceMatchStart, the turn events and diceMatchEnd follow as for two players, with null for the opponent's seat. Returns the match id, and throws if the player is not at a table, is already playing, or an option is unusable.
dice.setNames()
Dice.setNames(match, first, second)Changes the names both games show. Returns false if there is no such match.
dice.stop()
Dice.stop(match)Ends a match with no winner and the reason 'stopped'. Returns false if there is no such match.
dice.gameOf()
Dice.gameOf(player)The match a player is in, or 0.
dice.sit()
Dice.sit(player)Seats a player on a free chair of the table they are at, within 3 m, to wait for a match. Their game walks them there and plays the sit-down. The chair stays theirs while seated or playing, and standing up frees it. Returns the chair, 0 or 1, or the one already held. Returns -1 if they are playing, not at a table, or both chairs are taken.
dice.sittersAt()
Dice.sittersAt(table)The network ids of those holding a table's two chairs, [chair 0, chair 1], with null for a free one. A player holds a chair while walking to it, and `player.seated` shows when they sit.
dice.kinds()
Dice.kinds()The game's dice kinds, with their names and weights.
dice.badges()
Dice.badges()The game's badges, with their names, effects and tiers.
dice.badgeUses()
Dice.badgeUses(match)Badge uses left in a match, as [seat 0, seat 1], or null.
dice.badgesOf()
Dice.badgesOf(match)Each seat's badge in a match, as { name, inEffect } or null, or null with no match.
dice.diceOf()
Dice.diceOf(match)Each seat's six dice kinds in a match, with null for plain dice.
dice.watchers()
Dice.watchers(match)The network ids of players watching a match.