Configuration Reference
All configuration lives in config.lua, which is escrow_ignore-listed — you always have full access to it.
General
MBT.Debug = false
MBT.Framework = "ESX" -- "ESX" or "QB"
MBT.Timezone = 0| Option | Type | Default | Description |
|---|---|---|---|
MBT.Debug | boolean | false | Prints debug messages to the console. Disable in production. |
MBT.Framework | string | "ESX" | Set to "ESX" for ESX Legacy or "QB" for QBCore. Must match the running framework exactly. |
MBT.Timezone | number | 0 | UTC offset in hours applied to timestamps in draws.json and prize delivery time logs. 0 uses the server's local time. |
TxAdmin Integration
MBT.UseTxAdmin = true
MBT.GlobalKickTime = 60| Option | Type | Default | Description |
|---|---|---|---|
MBT.UseTxAdmin | boolean | true | When true, the script listens for txAdmin:events:serverShuttingDown and txAdmin:events:scheduledRestart to auto-save stats. Set to false if you don't use TxAdmin and trigger mbt_ratio:manualSaving yourself. |
MBT.GlobalKickTime | number | 60 | Seconds before a scheduled TxAdmin restart at which all players are kicked (to ensure clean data before the database write). |
Discord Names
MBT.UseDiscordNames = false
MBT.DiscordServerID = ""
MBT.BotToken = ""| Option | Type | Default | Description |
|---|---|---|---|
MBT.UseDiscordNames | boolean | false | When true, player display names in the leaderboard and prize logs are fetched from your Discord server instead of using FiveM names. |
MBT.DiscordServerID | string | "" | Your Discord guild (server) ID. Required if UseDiscordNames = true. |
MBT.BotToken | string | "" | Bot token with GuildMembers intent. Required if UseDiscordNames = true. |
Never commit your BotToken to a public repository. Keep config.lua private or use environment variables.
Open Key
MBT.OpenKey = {
["Active"] = true,
["Key"] = "F7",
}| Option | Type | Default | Description |
|---|---|---|---|
Active | boolean | true | When true, pressing the configured key opens the stats NUI. When false, only the /openRatio command works. |
Key | string | "F7" | Keyboard key bound via RegisterKeyMapping. Can be any valid FiveM key name. |
Physical Prop (Scoreboard)
MBT.Prop = {
["Model"] = `mbt_scoreboard`,
["Coords"] = vector3(195.17, -933.81, 32.06),
["Heading"] = 324.49,
}| Option | Type | Description |
|---|---|---|
Model | model | The prop hash to spawn as the scoreboard. The custom mbt_scoreboard model is included in the stream/ folder. |
Coords | vector3 | World position where the prop is created on client start. |
Heading | number | Rotation heading of the prop (0–360). |
DUI Screen (Leaderboard)
MBT.DUI = {
["Screen"] = {
["Width"] = 490,
["Height"] = 700,
["Scale"] = 0.38,
["Rotation"] = { ["X"] = 0.0, ["Y"] = 0.0, ["Z"] = 35.49 },
},
["Coords"] = vector3(192.67, -934.52, 34.41),
["Distance"] = 20.0,
["Refresh"] = 30,
}| Option | Type | Default | Description |
|---|---|---|---|
Screen.Width | number | 490 | Width of the DUI texture in pixels. |
Screen.Height | number | 700 | Height of the DUI texture in pixels. |
Screen.Scale | number | 0.38 | Scale multiplier for the rendered 3D scaleform. Adjust to resize the visible screen. |
Screen.Rotation | table | Z=35.49 | X/Y/Z rotation offsets for the DUI plane, used to align it with the prop surface. |
Coords | vector3 | — | World position of the DUI rendering plane. Should be placed on the prop's screen surface. |
Distance | number | 20.0 | Maximum distance in GTA units at which the DUI is rendered. |
Refresh | number | 30 | How often (in seconds) the server recalculates the leaderboard and pushes it to all clients. |
UI Labels
MBT.UI = {
["Description"] = [[ ... ]],
["Labels"] = {
["Kills"] = "Kills",
["Deaths"] = "Deaths",
["Headshots"] = "Headshots",
["Refiniture"] = "Malibu KD",
}
}All visible text in the personal NUI panel. Edit Description to change the info text shown in the panel header, and Labels to translate or rename the stat names.
Blacklisted Death Causes
MBT.BlacklistedDeathCause = {
`VEHICLE_WEAPON_ROTORS`,
`WEAPON_RUN_OVER_BY_CAR`,
`WEAPON_RAMMED_BY_CAR`,
0,
}Deaths caused by any weapon hash in this list are ignored — they do not increment the victim's death counter and do not count as a kill for anyone. Add GTA weapon hashes to exclude other death types (e.g. falling, drowning).
Prize Draw
MBT.PrizeDraw = {
["Frequency"] = "Weekly",
["Weekly"] = { ["Day"] = "Tuesday" },
["Monthly"] = { ["Day"] = 1 },
["PrizeInfo"] = { ... }
}| Option | Type | Default | Description |
|---|---|---|---|
Frequency | string | "Weekly" | "Weekly" checks the day name against Weekly.Day. "Monthly" checks the day number against Monthly.Day. |
Weekly.Day | string | "Tuesday" | English week day name when the prize is drawn: "Monday", "Tuesday", … "Sunday". |
Monthly.Day | number | 1 | Day-of-month (1–31) when the prize is drawn. |
PrizeInfo | table | — | Array of prize entries; one item per entry, each rolled independently (see below). |
PrizeInfo entry format
{
Type = "item",
Name = "WEAPON_PISTOL50",
DropChances = {
{ RollRange = { Min = 1, Max = 97 }, Quantity = 1 },
{ RollRange = { Min = 98, Max = 100 }, Quantity = 2 },
}
}Each entry is rolled with a math.random(1, 100). If the result falls within a RollRange, that Quantity of the item is added to the prize pool. Multiple entries can match in the same roll (one roll per entry). Name = "money" is treated as cash by the delivery function.
Prize Delivery Function
MBT.DeliverPrizeFunction = function(data)
-- data.Source — server ID of the winner
-- data.Prize — array of { itemName, quantity }
-- data.QBPlayer — QBCore player object (or false)
-- default preset uses ox_inventory:AddItem
endReplace the body with your own inventory calls if you don't use ox_inventory. The function must return true on success or return false, errorString on failure. If it returns false, the system retries after 20 seconds.
Other Config Functions
MBT.Notification = function(source, text, text2)
TriggerClientEvent('esx:showNotification', source, text)
endReplace with your server's notification system. Called when a prize delivery succeeds or fails.
Draw Log File
Prize draw results are written to server/draws.json automatically. The file is organised by month → draw day:
{
"February": {
"Tuesday-4": {
"WinnerId": "license:abc123",
"Winner": "PlayerName",
"Prize": "[{\"itemName\":\"money\",\"quantity\":50}]",
"Time": "18:30",
"Processed": true,
"Delivered": true
}
}
}Once Delivered is true, the draw for that day is locked and will not trigger again.
Other Settings
MBT.TimeBeforeWinnerCheck = 40| Option | Type | Default | Description |
|---|---|---|---|
MBT.TimeBeforeWinnerCheck | number | 40 | Seconds after the winner logs in before the prize delivery attempt begins. Gives the player time to fully load in. |