dxDrawPointLight
Client
Lights a point in every direction for a single frame, without creating an element.
bool dxDrawPointLight(float x, y, z, float radius, color color [, float intensity = 1, float falloff = 4, bool castShadow = false])
Parameters
| Name | Type | Description |
|---|---|---|
| x, y, z | float | The light's position in the world, three numbers or a vec3. |
| radius | float | Range in metres, above 0 and up to 1000. |
| color | color | Three numbers r, g, b (integers from 0 to 255) or a tocolor value. Alpha is ignored. |
| intensity | float | Brightness multiplier, from 0 to 1000. At 1, a white light shines with an HDR radiance of 12.default 1 |
| falloff | float | Exponent of the fade toward the radius, from 0.1 to 32. Higher values keep the light strong closer to its edge.default 4 |
| castShadow | bool | Whether the light casts shadows.default false |
Returns
true if the light was queued for the frame. false when 256 lights are already queued, or with a wrong argument.
The light lasts one frame. A call made before the world is drawn (for example in onClientPreRender or onClientRender) lights that frame; one made after it lights the next. Calls made while no frame runs are dropped. Going over 256 lights in a frame logs a warning once, until a frame leaves room in the queue.
Example
addEventHandler("onClientPreRender", root, function()
local pos = getElementPosition(localPlayer)
dxDrawPointLight(pos.x, pos.y, pos.z + 1, 6, 120, 180, 255, 2)
end)Coming from MTAMTA has no dynamic lights.