Client API
Every export below is client-side. Call them onexports.road_minigolf.
Exports
OpenCourseMenu
Opens the course menu of a course, for example from your own target zone or a phone app.string
required
The course ID
The server still checks that the player stands at the course start and is
out of a vehicle before a game can be opened, joined or started.
IsInGame
boolean
true while the local player is in a round: a game, practice or an editor
test.OpenEditor
Opens the course editor, as F7 does. The server checks admin rights.IsEditorActive
boolean
true while the editor is open.ShowcaseCue
For trailers and camera tools. After an admin ran/mgshowcase at a course, this export plays
a hole so that a chosen moment happens on time. Only the calling client sees
these balls, and they wait for the windmill sails.
string
required
The course ID
number
required
The hole number, starting at 1
string
required
'start', 'loop', 'windmill', 'tunnel', 'ramp' or 'cup'number
required
Seconds from now at which the moment should happen at the earliest
number | nil
Seconds until the moment, or
nil when /mgshowcase found no stroke for that
hole or the hole has no such moment.ShowcaseStop
Stops every showcase ball on this client.State bags
For HUD, phone and inventory scripts that should stay out of the way during a round.Player(source).state.inMinigolf.
Events
Local client events, triggered withTriggerEvent. Listen with
AddEventHandler.
The weapon in the player’s hands is put away for the putter and given back
after the round. With ox_inventory the inventory manages weapons itself.