Takaro module library
Takaro Modules
Takaro is a game server management platform for running, automating, and moderating multiplayer communities. These modules install into Takaro to add server automation, Discord workflows, economy systems, and moderation tools.
ZombieRacing
Zombie Racing

What it adds
- Configurable racers with custom names, labels, odds, and weighted winner chances.
- Currency betting through Takaro economy, including minimum and maximum bet limits.
- Scheduled races through cron jobs, plus an admin command for manual starts.
- Live race commentary messages for early, middle, and late race moments.
- Player race stats, current bets, last race results, and a leaderboard.
- Recovery logic for interrupted running races so race state, payouts, and stats stay consistent.
Configuration
Name; Odds lines, for example Biker; 2, where the number controls the payout multiplier.

Commands
| Command | Permission | Purpose |
|---|---|---|
/racebet <racer> <amount> | RACING_BET | Place or replace a bet for the next race. |
/racers | RACING_BET | Show available racers, odds, next race timing, and bet limits. |
/myracebets | RACING_BET | Show your current or locked race bets. |
/nextrace | RACING_BET | Show upcoming race status and your active bets. |
/lastrace | RACING_BET | Show the latest race winner, standings, and your result. |
/racestats | RACING_BET | Show your personal betting statistics. |
/raceleaderboard | RACING_BET | Show the top racing bettors by net winnings. |
/startrace | RACING_ADMIN | Start a race manually. |
Hooks and cron jobs
announceRace and startRace handle scheduled announcements and race starts. The finish hooks complete scheduled or manually started races after the configured delay, and commentary hooks send live race updates. recoverRunningRace can finish or clean up a race that was interrupted while running.
Requirements
RACING_BET to players who can place race bets and RACING_ADMIN to staff who can start races manually.Components Overview
Updated 5 Commands
raceCommentaryEarlyAfterScheduledStart (cronjob-executed), raceCommentaryMiddleAfterScheduledStart (cronjob-executed), raceCommentaryLateAfterScheduledStart (cronjob-executed), raceCommentaryEarlyAfterManualStart (command-executed), raceCommentaryMiddleAfterManualStart (command-executed), raceCommentaryLateAfterManualStart (command-executed), finishRaceAfterScheduledStart (cronjob-executed), finishRaceAfterManualStart (command-executed). Added 2 scheduled tasks: startRace, recoverRunningRace. New configuration options: commentaryEarlyTemplates, commentaryMiddleTemplates, commentaryLateTemplates. Updated 5 command implementations.New Module: ZombieRacing
NEWraceleaderboard, racers, racestats, startrace, lastrace, nextrace, myracebets, racebet. Added 2 scheduled tasks: announceRace, runRace. Added 1 function: utils. New permissions: RACING_BET, RACING_ADMIN. New configuration options: minBet, maxBet, racerTypeLabel, racerTypePluralLabel, raceName, entrants.Configuration
Configure this module using the schemas below. The JSON schema defines the data structure, while the UI schema customizes how the configuration form is displayed.
Configuration Schema
Configuration Properties (9)
minBet
Minimum amount required to place a bet
50maxBet
Maximum amount allowed for a bet
1000Racer type label
Singular label for racers in command output.
zombieRacer type plural label
Plural label for racers in command output.
zombiesRace name
Display name for races.
Zombie RaceEntrants
List of racers. Format: Name; Odds (whole number) - one racer per line.
"Biker; 2""Arlene; 3"Early race commentary templates
Messages used for the first live race update. Supports {winner}, {leader}, {rival}, {raceName}, {racer}, and {racers}.
["{leader} jumps out first, but {winner} is staying close.","{leader} takes the early lead while {winner} waits for an opening.","{leader} is setting the pace. {winner} is right behind."]Middle race commentary templates
Messages used for the second live race update. Supports {winner}, {leader}, {rival}, {raceName}, {racer}, and {racers}.
["{winner} is catching {leader} fast. {rival} is trying to keep pace.","{winner} closes the gap on {leader}; {rival} is still in the mix.","{leader} is under pressure now. {winner} is gaining ground."]Late race commentary templates
Messages used for the final live race update before results. Supports {winner}, {leader}, {rival}, {raceName}, {racer}, and {racers}.
["{winner} overtakes {leader} in the final stretch.","{winner} surges past {leader}; the finish line is close.","{winner} finds another gear and takes the lead from {leader}."]UI Schema
No UI schema defined. Configuration form will use default rendering.
About Configuration Schemas
The Configuration Schema defines the structure and validation rules for module settings. The UI Schema customizes how the configuration form is displayed in the Takaro interface, including field ordering, labels, and input types.
Commands (8)
These commands can be executed by players in-game. Each command has a trigger word, optional arguments, and executes JavaScript code on the server.
racers
Description
Function Implementation
racers Function
JAVASCRIPTUsage Example
racestats
Description
Function Implementation
racestats Function
JAVASCRIPTUsage Example
startrace
Description
Function Implementation
startrace Function
JAVASCRIPTUsage Example
lastrace
Description
Function Implementation
lastrace Function
JAVASCRIPTUsage Example
nextrace
Description
Function Implementation
nextrace Function
JAVASCRIPTUsage Example
myracebets
Description
Function Implementation
myracebets Function
JAVASCRIPTUsage Example
racebet
Description
Arguments (2)
racer
stringPosition 0""amount
numberPosition 1"0"Function Implementation
racebet Function
JAVASCRIPTUsage Example
About Module Commands
Commands allow players to interact with your module through chat. Each command has a trigger word that players type (prefixed with /), optional arguments for parameters, and a JavaScript function that executes when the command is used. Arguments are automatically validated and passed to the function.
Hooks (8)
These hooks respond to various game events automatically. Each hook executes JavaScript code when its specific event type occurs, allowing modules to react to player actions, system changes, and more.
Player Events
raceCommentaryEarlyAfterManualStart
Description
Function Implementation
raceCommentaryEarlyAfterManualStart Hook Function
JAVASCRIPTEvent Details
raceCommentaryMiddleAfterManualStart
Description
Function Implementation
raceCommentaryMiddleAfterManualStart Hook Function
JAVASCRIPTEvent Details
raceCommentaryLateAfterManualStart
Description
Function Implementation
raceCommentaryLateAfterManualStart Hook Function
JAVASCRIPTEvent Details
finishRaceAfterManualStart
Description
Function Implementation
finishRaceAfterManualStart Hook Function
JAVASCRIPTEvent Details
Custom Events
raceCommentaryEarlyAfterScheduledStart
Description
Function Implementation
raceCommentaryEarlyAfterScheduledStart Hook Function
JAVASCRIPTEvent Details
raceCommentaryMiddleAfterScheduledStart
Description
Function Implementation
raceCommentaryMiddleAfterScheduledStart Hook Function
JAVASCRIPTEvent Details
raceCommentaryLateAfterScheduledStart
Description
Function Implementation
raceCommentaryLateAfterScheduledStart Hook Function
JAVASCRIPTEvent Details
finishRaceAfterScheduledStart
Description
Function Implementation
finishRaceAfterScheduledStart Hook Function
JAVASCRIPTEvent Details
About Module Hooks
Hooks allow your module to respond automatically to game events like player actions, server status changes, and chat messages. Each hook has an event type that determines when it triggers, optional regex patterns for filtering specific events, and a JavaScript function that executes when the conditions are met. Hooks are grouped by category for better organization.
Scheduled Jobs (3)
These jobs run automatically on a schedule defined by cron expressions. Each job executes JavaScript code at specific times or intervals.
announceRace
Description
Schedule Details
Cron Expression
Human-Readable Schedule
At minute 45 at 1 AM on every day of the month in every month on every day of the week
Function Implementation
announceRace Function
JAVASCRIPTCron Expression Format
Each field can contain numbers, ranges (1-5), lists (1,3,5), or wildcards (*). Use */n for intervals (e.g., */5 for every 5 units).
startRace
Description
Schedule Details
Cron Expression
Human-Readable Schedule
Every 2 hours
Function Implementation
startRace Function
JAVASCRIPTCron Expression Format
Each field can contain numbers, ranges (1-5), lists (1,3,5), or wildcards (*). Use */n for intervals (e.g., */5 for every 5 units).
recoverRunningRace
Description
Schedule Details
Cron Expression
Human-Readable Schedule
Every minute
Function Implementation
recoverRunningRace Function
JAVASCRIPTCron Expression Format
Each field can contain numbers, ranges (1-5), lists (1,3,5), or wildcards (*). Use */n for intervals (e.g., */5 for every 5 units).
About Scheduled Jobs
Cron jobs allow your module to execute code automatically on a schedule. Each job has a cron expression that defines when it runs, and a JavaScript function that executes at those times. Jobs run server-side and can perform maintenance tasks, send notifications, or update game state automatically.
Functions (1)
Reusable JavaScript functions that can be imported and used by other module components like commands, hooks, and cron jobs. These promote code reuse and modularity.
utils
Function Implementation
utils Function
JAVASCRIPTImport Usage
About Module Functions
Functions are reusable JavaScript components that can be imported and used by commands, hooks, and cron jobs within your module. They promote code reuse, improve maintainability, and allow you to organize complex logic into modular pieces. Functions must be exported with proper ES6/CommonJS syntax to be importable by other components.
Permissions (2)
These permissions control who can access different features of this module. Administrators can assign these permissions to roles, allowing fine-grained access control.
General Permissions
Racing Admin
RACING_ADMINPermission KeyDescription
Allows the player to manage races
Permission Details
RACING_ADMINPlace Racing Bets
RACING_BETPermission KeyDescription
Allows the player to bet on races
Permission Details
RACING_BETAbout Module Permissions
Permissions control access to module features and functionality. Each permission has a unique key for identification, a friendly name for display, and a description explaining what it allows. Some permissions are countable, meaning they can have numeric values or limits assigned. Administrators assign these permissions to user roles to control who can use different module features.



































