> For the complete documentation index, see [llms.txt](https://docs.vames-store.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vames-store.com/assets/vms_housing/developer-api/server-events.md).

# Server Events

### Generating dirt

Creating dirt for the house.

You can use this in your eating / drinking system when a player eats, they may leave a stain or crumbs.

```lua
---@param {propertyId: number | string}
---@param {model: string}: Dirt object model from VMS Housing files
---@param {position: vector3}
---@param {heading: number}
TriggerServerEvent('vms_housing:sv:spawnDirt', propertyId, model, position, heading)
```

<details>

<summary>Dirt Models</summary>

<kbd>vms\_blood1</kbd>\ <kbd>vms\_blood1small</kbd>\ <kbd>vms\_blood2</kbd>\ <kbd>vms\_blood2small</kbd>\ <kbd>vms\_dirtfootsteps</kbd>\ <kbd>vms\_coffeestain1</kbd>\ <kbd>vms\_coffeestain2</kbd>\ <kbd>vms\_crumbs1</kbd>\ <kbd>vms\_crumbs2</kbd>\ <kbd>vms\_dirtmud1</kbd>\ <kbd>vms\_dirtmud2</kbd>\ <kbd>vms\_dirtmud3</kbd>\ <kbd>vms\_dirtmud4</kbd>\ <kbd>vms\_ketchupspill</kbd>\ <kbd>vms\_liquidspill1</kbd>\ <kbd>vms\_liquidspill2</kbd>\ <kbd>vms\_liquidspill3</kbd>\ <kbd>vms\_liquidspill4</kbd>\ <kbd>vms\_mustardspill</kbd>\ <kbd>vms\_oilspill1</kbd>\ <kbd>vms\_oilspill2</kbd>\ <kbd>vms\_sodaspill1</kbd>\ <kbd>vms\_winestain1</kbd>

</details>

<details>

<summary><strong>Example</strong></summary>

```lua
local myPed = PlayerPedId()
local myCoords = GetEntityCoords(myPed)
local heading = GetEntityHeading(myPed)

local propertyId, propertyData = exports['vms_housing']:IsPlayerInsideProperty()
if not propertyId then
    return
end

local model = 'vms_crumbs1'
local position = vector3(myCoords.x, myCoords.y, myCoords.z - 0.99) -- Setting foot coordinates

TriggerServerEvent('vms_housing:sv:spawnDirt', propertyId, model, position, heading)
```

</details>

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.vames-store.com/assets/vms_housing/developer-api/server-events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
