# setElementOnFire (Client)

> Sets an element on fire or puts it out on this client.

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

## Syntax

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

## Parameters

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

## Returns

`true` if it applied, `false` if the element is not streamed in, cannot burn or came from the server.

## Example

```lua
local ped = createPed("bfori", 2495, -1687, 13.5)
setTimer(function()
    setElementOnFire(ped, true)
end, 1000, 1)
```

### Note

Elements the server created cannot be changed here, except the local player.

## See also

- [isElementOnFire (Shared)](https://wiki.mymp.gg/en/isElementOnFire.md): Tells whether an element is on fire.
- [setElementOnFire (Server)](https://wiki.mymp.gg/en/setElementOnFire-server.md): Sets an element and its children on fire, or puts them out, for every player.
