circle-playMissions

Mission System

The mission system allows players to earn coins by completing various tasks. It supports both automatic tracking missions and custom missions that integrate with your other resources.

Mission Types

Built-in Mission Types

These missions track automatically without additional coding:

Type
Description
Automatic Tracking

distance_walked

Tracks player walking distance

✅ Yes

distance_driven

Tracks vehicle driving distance

✅ Yes

jumps

Tracks player jumps

✅ Yes

location_discovery

Tracks visiting specific locations

✅ Yes

Custom Mission Types

Type
Description
Automatic Tracking

custom

Missions triggered via server events

❌ Manual trigger required

Adding Built-in Missions

Add missions to Config.Missions.BuiltInMissions in shared/config.lua:

Config.Missions = {
    BuiltInMissions = {
        {
            id = "walker_basic",
            name = "Daily Walker",
            description = "Walk {target} meters on foot",
            type = "distance_walked",
            target = 2000,
            reward = 100,
            enabled = true,
            weight = 10
        },
        {
            id = "driver_city",
            name = "City Driver", 
            description = "Drive {target} meters with a vehicle",
            type = "distance_driven",
            target = 15000,
            reward = 150,
            enabled = true,
            weight = 8
        },
        {
            id = "jumper_parkour",
            name = "Parkour Pro",
            description = "Jump {target} times",
            type = "jumps",
            target = 100,
            reward = 75,
            enabled = true,
            weight = 6
        }
    }
}
circle-info

The {target} placeholder gets replaced with the actual target value in the UI.

Adding Custom Missions

Custom missions require manual progress triggering from your other resources:

Location Discovery Missions

For missions that require visiting specific locations:

Mission Properties

Property
Type
Description
Required

id

String

Unique mission identifier

✅ Yes

name

String

Display name in UI

✅ Yes

description

String

Mission description with {target} placeholder

✅ Yes

type

String

Mission type (see types above)

✅ Yes

target

Number

Goal amount to complete mission

✅ Yes

reward

Number

Coins given when completed

✅ Yes

enabled

Boolean

Whether mission is active

✅ Yes

weight

Number

How often mission appears (1-10, higher = more frequent)

✅ Yes

triggerEvent

String

Event name for custom missions

⚠️ Custom only

triggerKey

String

Key passed to event for custom missions

⚠️ Custom only

locations

Array

Array of locations for discovery missions

⚠️ Location only

Location Object Properties

Property
Type
Description
Example

name

String

Location name

"Hospital"

coords

Vector3

Location coordinates

vector3(295.0, -1446.0, 29.0)

radius

Number

Detection radius in meters

50

Triggering Custom Mission Progress

From your other resources, trigger mission progress using events:

Parameters:

  • source - Player server ID

  • mission_id - The mission ID from config (must match triggerKey)

  • progress - Amount to add to progress (usually 1)

Integration Examples

Job Script Integration

Taxi Job Integration

Delivery Script Integration

Mechanic Job Integration

Fishing Script Integration

Mission Configuration Examples

Trucker Job Missions

Police Job Missions

Medical Job Missions

Mission Management

Mission Reset System

Missions automatically reset daily at midnight server time. Progress is tracked per player and mission.

Mission Weights

Weight determines how frequently a mission appears:

Weight
Frequency

1-3

Rare

4-6

Uncommon

7-8

Common

9-10

Very Common

Enabling/Disabling Missions

Best Practices

circle-check
  1. Use unique mission IDs to avoid conflicts with other resources

  2. Set realistic targets - not too easy, not impossible

  3. Balance rewards with effort required

  4. Test progress triggers thoroughly before deploying

  5. Use descriptive names that players understand

  6. Consider server population when setting targets

  7. Weight missions appropriately - harder missions should be rarer

circle-info

Integration Notes

  • Built-in missions track automatically - no additional code needed

  • Custom missions require manual progress triggering via events

  • Location discovery missions need valid coordinates and reasonable radius

  • Mission progress is cumulative and persists until daily reset

  • VIP players receive multiplied mission rewards based on Config.VIP.Multipliers.Rewards

circle-exclamation
  • Always test custom mission triggers with your specific job scripts

  • Mission IDs must be unique across all missions

  • Location coordinates should be tested in-game for accuracy

  • Weight values affect mission selection probability - use wisely

Last updated