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.

---@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)
Dirt Models

vms_blood1 vms_blood1small vms_blood2 vms_blood2small vms_dirtfootsteps vms_coffeestain1 vms_coffeestain2 vms_crumbs1 vms_crumbs2 vms_dirtmud1 vms_dirtmud2 vms_dirtmud3 vms_dirtmud4 vms_ketchupspill vms_liquidspill1 vms_liquidspill2 vms_liquidspill3 vms_liquidspill4 vms_mustardspill vms_oilspill1 vms_oilspill2 vms_sodaspill1 vms_winestain1

Example
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)

Last updated

Was this helpful?