# Server: CreateFire(payload, creator)

> Reference for Server: CreateFire(payload, creator) in firejob.

[All exports](/docs/jobs/firejob/reference/exports)

**Optional developer integration.** Call this export from a **server script** in your own resource after `sky_firejob` has started. For normal installation and gameplay, use [Installation](/docs/jobs/firejob/setup/installation).

## Server Exports

### `CreateFire(payload, creator)`

Creates a regular synchronized fire with Firejob's normal spread, extinguishing, dispatch, effects, and lifecycle behavior.

<table>
<thead>
  <tr>
    <th>
      Argument / payload field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required / default
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        payload
      </code>
    </td>
    
    <td>
      <code>
        table
      </code>
    </td>
    
    <td>
      Required
    </td>
    
    <td>
      Fire creation data
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        payload.coords
      </code>
    </td>
    
    <td>
      <code>
        { x, y, z }
      </code>
      
       or <code>
        vector3
      </code>
    </td>
    
    <td>
      Required
    </td>
    
    <td>
      World position with numeric coordinates
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        payload.type
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        "trash"
      </code>
    </td>
    
    <td>
      A configured fire profile or alias
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        payload.metadata
      </code>
    </td>
    
    <td>
      <code>
        table
      </code>
    </td>
    
    <td>
      Optional
    </td>
    
    <td>
      Overrides for this fire, described below
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        creator
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        0
      </code>
    </td>
    
    <td>
      Player server ID for creation/dispatch context, or <code>
        0
      </code>
      
       for a scripted incident
    </td>
  </tr>
</tbody>
</table>

Common metadata fields are `locationType` (`"interior"` or `"exterior"`), `sourceScale` (scale multiplier), `smokeDensity` (`0.0`–`1.0`), `material`, `scenePropsEnabled`, and `reignitable`. Reignition overrides include `reignitionEnabled`, `reignitionChancePercent`, and `reignitionDelaySeconds`. Omitted settings follow the fire profile and Firejob configuration.

The export returns **one table**:

- Success: `success = true`, `fireId` (`number`), `type` (`string`), and `label` (`string`).
- Failure: `success = false` and `error` (`string`). Possible errors are `invalid_payload`, `invalid_coords`, `invalid_fire_type`, and `create_failed`.

```lua
-- server.lua; choose coordinates appropriate for your incident.
local result = exports["sky_firejob"]:CreateFire({
    type = "trash",
    coords = { x = 215.0, y = -810.0, z = 30.0 },
    metadata = {
        locationType = "exterior",
        sourceScale = 1.0,
        smokeDensity = 0.8,
        scenePropsEnabled = false
    }
}, 0)

if not result.success then
    print(("Could not create fire: %s"):format(result.error))
    return
end

local fire_id = result.fireId
print(("Created fire %s (%s)"):format(fire_id, result.type))
```

Creation notifications are silent by default. Set `metadata.silent = false` and supply a player `creator` to send the normal creation notification. `fireId` identifies a Firejob fire; it is not a vehicle network ID or an oil spill ID. Regular fires follow Firejob's extinguishing and configured expiry lifecycle; this page does not provide a `RemoveFire` export.
