# Engine Swapping

Doing an engine swap, involves creating a command or script to execute the export to set the vehicle engine.\
\
It is important to remember that C.H.A.S.E.R, will not save the swapped engine, and a independent saving/loading system should be made.\
\
Luckly, we already provide a functional demo for that, [and it can be accessed here](https://github.com/LegacyDMC/chaserdemo/tree/main/chaser_db_tuner)\
\
In order to create a command to engine swap your car, create a lua resource and paste the following code:\
\
(Note: in order to swap back to the original engine, simply do "setengine stock")

```lua
local chaser = exports['legacydmc_chaser'] -- the export HAS to be "legacydmc_chaser"

RegisterCommand("setengine", function(source, args, rawCommand)
    if #args < 1 then
        print("Please insert an engine..")
        return
    end
    local engine = args[1]
    if chaser:chaser_getloadstatus() then
        chaser:chaser_setengine(engine)
        Citizen.Wait(50)
        chaser:chaser_refreshengine()
    end
end, false)

```


---

# 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://legacydmc.gitbook.io/chaser/fundamentals/engine-swapping.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.
