Server Side
Exports & Events
StartMission
Starts a mission for a player. Soft gates (cooldown / requirements) are skipped via forced = true, but exclusive / maxPlayers are still enforced.
Returns: ok, reason
local ok, reason = exports['op-missioncreator']:StartMission(src, missionId, opts)-- Example
local ok, err = exports['op-missioncreator']:StartMission(source, 'my_heist', {
startStepId = 'step_1', -- optional
})StartMissionWithLobby
Creates a co-op lobby with a fixed host + member roster and starts the mission immediately (no invite UI). The host is always included - members is a list of additional player server ids.
Returns: ok, lobbyId on success, false, reason on failure.
opts.forced defaults to true. opts.startStepId is optional.
local ok, lobbyId = exports['op-missioncreator']:StartMissionWithLobby(host, missionId, members, opts)-- Example
local ok, result = exports['op-missioncreator']:StartMissionWithLobby(
1, -- host server id
'my_heist',
{ 2, 3 }, -- additional members
{ startStepId = 'step_1' }
)StopMission
Stops the player's current mission and clears the server registry slot.
CanStartMission
Dry-run of the start gate. Checks requirements / cooldown / exclusive / queue / etc. without consuming items or starting anything.
Returns: ok, reason
GetMissionRegistry
Returns all registered mission definitions ({ [missionId] = def, ... }).
BroadcastMissionEvent
Sends a named event into the player's running mission runtime (received as a mission event on the client).
OpCrimeStart
op-crime tablet entry point. Routes by mission settings:
queue enabled -> queue join
coop allowed -> client invite / lobby flow
otherwise -> direct start (requirements consumed)
Returns: ok, 'started'|'queued'|'invite_pending' or false, reason
GetOpCrimeMissions
Returns missions marked as exposed to op-crime, shaped for op-crime Config.Missions.
IsOpCrimeIntegrationActive
Returns a boolean - whether the op-crime integration is currently active.
Server Events
op-missioncreator:server:missionStarted
Fired after a mission successfully starts for a player.
op-missioncreator:server:missionEnded
Fired when a mission ends for a player.
status is one of: 'completed' | 'failed' | 'aborted' | 'queue_left' | 'lobby_closed'
Last updated