ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. createGroundDecal

Function

createGroundDecal

New function!Added to Trilogy Hub on 2 Nov 2026.

ClientDrawing (dx)Trilogy Hub only

Lays an image on the ground - a track, a stain or a place marker. The image follows slopes and kerbs instead of hanging flat above them. It is drawn up to 150 m from the camera, and with a lifetime set the last second fades out smoothly. The decal stays until destroyGroundDecal or until the resource stops.

Syntax

int createGroundDecal(string material, number x, number y, number z, number size [, number rotation = 0, int lifetime = 0, int color = white])

Arguments

materialstring
A resource image path or a texture from dxCreateTexture.
xnumber
Centre X.
ynumber
Centre Y.
znumber
Height from which the ground is searched.
sizenumber
Square side in metres (0.1-50).
rotationnumber, optional = 0
Rotation in degrees.
lifetimeint, optional = 0
Lifetime in ms, 0 = until removed.
colorint, optional = white
Colour from tocolor.

Returns

Decal number or false.

Example

addCommandHandler("plama", function()
    local x, y, z = getElementPosition(localPlayer)
    createGroundDecal("img/plama.png", x, y, z, 2, math.random(0, 360), 30000, tocolor(255, 255, 255, 220))
end)

See also