setVehicleNeonPower
Shared
Changes the brightness of a vehicle's neon.
bool setVehicleNeonPower(element element, float power)
Parameters
| Name | Type | Description |
|---|---|---|
| element | element | A vehicle, or a parent element: every vehicle below it changes too. |
| power | float | Brightness relative to the default: 1 is normal, 0 is dark. It cannot be negative. |
Returns
true if it changed, false if it is not a vehicle. Raises an error if power is negative.
On the server, the change is sent to every client. On the client, it applies to this client only.
Example
local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
local t = 0
setTimer(function()
t = t + 0.2
setVehicleNeonPower(vehicle, 1 + math.sin(t) * 0.5)
end, 50, 0)
endNoteWith a parent element (such as
root), every vehicle below changes, but the return value is the element's own, which is not a vehicle: false.