Skip to main content

Configuration

Road Minigolf has two config files and two hook files. None of them is overwritten by an update.
config.lua only lists what servers usually change. Every other value (ball physics, putting stance, camera feel, editor tools, timings) has its default in shared/defaults.lua. To change one, copy the key into the matching table of config.lua. Keys missing from config.lua always use the defaults, so an update never breaks an older config.

General

config.lua

Permissions

A player is admin (editor, import/export, admin commands) when any check matches.
config.lua
server.cfg

Keys and commands

config.lua
These are the defaults of FiveM key mappings. Players can rebind every key under Settings → Key Bindings → FiveM. The editor tool keys 1–6 are in Config.Editor.keys. Every command name can be changed in Config.Commands. See Commands & Keybinds.

Notifications

config.lua
For any other script, set Config.Notify = function(message, kind) … end in config.lua or use the OpenHooks.Notify client hook. The order is Config.Notify, then OpenHooks.Notify, then Config.NotifyProvider.

World

config.lua
Each course can have its own blip sprite and colour, set in the editor’s General tab.

Game

config.lua

Economy

Entry fees and rewards need ESX, QBCore, Qbox or your own money functions. Each course can override the fee and rewards in the editor.
config.lua
'money' and 'cash' mean the same wallet: the script maps one to the other for the framework it finds.
How money is handled:
  • Rewards are paid only for rounds where every hole was holed. The win reward goes only to a sole winner (ties get none).
  • A cooldown per player and course (rewardCooldownMin) and a minimum round duration (minSecondsPerHole) apply.
  • Entry fees are refunded whenever a game is cancelled.

Society account

Entry fees of every finished game can go to a business account. Set it in config.server.lua:
config.server.lua
ESX addon accounts, qb-management, qbx_management and okokBanking are supported through the bundled bridge. With prizePot = true the fees go to the winner instead.

Custom money functions

For any other economy, add your own functions in config.server.lua:
config.server.lua

Anti-cheat

The server is the referee: it counts the shots, a “holed” ball needs a counted shot and a plausible roll time, and the round is scored against the course layout captured at the start.
config.lua
Flags never punish on their own. They fire the local server event road_minigolf:server:suspicious, the OpenHooks.OnSuspicious hook and a Discord log. Ban or warn there if you want to.

Discord logs

Turn logging on in config.lua and put one webhook URL per category into config.server.lua. A category without a URL logs nothing.
config.lua
config.server.lua
Every entry carries the player’s identifier. Entries are queued and sent in batches, within Discord’s rate limit.

Editor

config.lua
Config.PropCatalog holds the editor’s prop catalog. See Track Kit → Other props.

Sounds

Config.Sounds lists the GTA sounds for hits, the cup, walls, water, birdie, eagle, records, the finish, errors, the countdown and lip-outs. Set one to false to turn it off.
config.lua

Putting stance and ball physics

The putting stance (Config.Anim), the putter offset and the ball physics (Config.Physics) have their defaults in shared/defaults.lua. If the putter meets the ball too early or too late on your server, tune it live: address a ball in a test, practice or solo round and type /mgputter. Change the values with the arrow keys and PgUp / PgDn, switch groups with Tab (putter position, putter rotation, stance, ball contact), and press Enter to print the lines for config.lua to the F8 console. Changes are live on your client only until you add those lines.

Hooks

server/open.lua and client/open.lua are not escrowed. Change them to fit your server.

Server hooks

server/open.lua
The file ships with examples for ESX, QBCore and Qbox.

Client hooks

client/open.lua
The state bag names in the shipped CanPlay examples (isDead, isCuffed, …) differ between scripts. Check them against the ambulance and police scripts you run.

Data files

Road Minigolf has no database. It writes JSON files into road_minigolf/data/: Every store is written to two alternating files and read back byte for byte before it is trusted. A damaged file never overwrites the last good copy, and a failed write is retried. If no copy of a file can be read, saving that store stays disabled and the console says so.
data/ is your server’s state: the courses your admins built. Back it up like a database, and never replace it with the empty folder from an update.
Courses from version 1.0 (courses.json, scores.json) are taken over automatically on the first start.