# setElementOnFire (Server)

> Sets an element and its children on fire, or puts them out, for every player.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Server
- **Category**: Elements
- **URL**: https://wiki.mymp.gg/en/setElementOnFire-server
- **Counterpart**: Also exists on the client, with its own implementation: [setElementOnFire (Client)](https://wiki.mymp.gg/en/setElementOnFire-client.md)

## Syntax

```lua
bool setElementOnFire(element element, bool onFire)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `element` | `element` | The player, ped, vehicle or object. |
| `onFire` | `bool` | `true` to set it on fire, `false` to put it out. |

## Returns

`true` if it applied to the element itself, `false` if it is not a player, ped, vehicle or object.

## Example

```lua
addCommandHandler("burn", function(player)
    setElementOnFire(player, true)
end)
```

## See also

- [isElementOnFire (Shared)](https://wiki.mymp.gg/en/isElementOnFire.md): Tells whether an element is on fire.
- [setElementOnFire (Client)](https://wiki.mymp.gg/en/setElementOnFire-client.md): Sets an element on fire or puts it out on this client.
