# Locations & Markers

This page explains all location-related config variables and how to customize where Community Service takes place.

***

### Key Locations

```lua
-- Where the player is teleported when sentenced
Config.ServiceLocation = { x = 3072.54, y = -4759.73, z = 15.26 }

-- Where the player is teleported after serving their sentence
Config.ReleaseLocation = { x = 427.33, y = -979.51, z = 30.2 }
```

| Variable                 | Default Location         | Description                      |
| ------------------------ | ------------------------ | -------------------------------- |
| `Config.ServiceLocation` | Bolingbroke Penitentiary | Teleport-in point when sentenced |
| `Config.ReleaseLocation` | Mission Row Police Dept  | Teleport-out point on release    |

> **Tip:** Use a server-side coordinate logger or press `F8` in-game with a native executor to get exact `x, y, z` values.

***

### Task Marker Locations

These are the spots where blue markers appear for players to interact with:

```lua
Config.ServiceLocations = {
    { type = "cleaning",  coords = vector3(3072.54, -4759.73, 15.26) },
    { type = "cleaning",  coords = vector3(3043.45, -4761.33, 15.26) },
    { type = "cleaning",  coords = vector3(3044.09, -4719.18, 15.26) },
    { type = "cleaning",  coords = vector3(3056.06, -4705.7,  15.26) },
    { type = "cleaning",  coords = vector3(3056.4,  -4690.82, 15.26) },
    { type = "gardening", coords = vector3(3043.99, -4683.34, 15.26) },
}
```

* The script randomly selects **5 locations** at a time from this list
* When a task is completed, a new random location replaces it
* The same location won't appear twice in the active 5

#### Adding New Locations

```lua
{ type = "cleaning",  coords = vector3(X, Y, Z) },
{ type = "gardening", coords = vector3(X, Y, Z) },
```

Replace `X, Y, Z` with your desired coordinates. The more locations you add, the more varied the experience.

***

### Escape Detection Zones

The script uses three layers of escape detection. If the player is **outside all of them**, they are teleported back and penalized.

#### Layer 1 — Work Area Circle

```lua
Config.WorkAreaCenter = vector3(1690.24, 2591.48, 45.56)
Config.WorkAreaRadius = 500.0
```

A large circular zone centered on a point. Good for open-world service areas.

#### Layer 2 — Service Center Radius

```lua
Config.ServiceCenterRadius = 650.0
```

A radius around `Config.ServiceLocation`. If the player is within this distance of the spawn point, they are considered in-bounds.

#### Layer 3 — Location Grace Radius

```lua
Config.LocationGraceRadius = 150.0
```

Each marker location has a grace circle of this radius. If the player is near **any** marker location, they are in-bounds.

***

### How Escape Detection is Evaluated

```
Is player within WorkAreaCenter + WorkAreaRadius?
    YES → In bounds ✓
    NO  → Check ServiceLocation + ServiceCenterRadius
              YES → In bounds ✓
              NO  → Check each ServiceLocations[i] + LocationGraceRadius
                        YES (any match) → In bounds ✓
                        NO              → ESCAPE DETECTED → teleport + penalty
```

***

### Recommended Setup

For a **prison yard** setup (e.g. Bolingbroke):

* Set `Config.ServiceLocation` to the prison entrance
* Place all `Config.ServiceLocations` inside the prison grounds
* Set `Config.WorkAreaRadius` to cover the full prison area
* Set `Config.ReleaseLocation` to a police station or court

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mohssins.gitbook.io/mohscriptsdocs/moh-stoptroll/locations-and-markers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
