setElementLighting | Multi Theft Auto: Wiki Skip to content

setElementLighting

Client-side
Server-side
Shared

Pair: getElementLighting

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function changes the lighting value for the specified element. This can be a player, ped, vehicle, object, weapon.

Note

Lighting is calculated in real-time every frame. Therefore, to correctly override the lighting, you should use this function in combination with the onClientPedsProcessed event, not only for peds, but also for vehicles and objects.

Syntax

setElementLighting ( )

Code Examples

client

This example sets the lighting value of all players and vehicles to 10

addEventHandler("onClientPedsProcessed",root,function()
for _, v in pairs(getElementsByType('player')) do
setElementLighting(v, 10)
end
for _, v in pairs(getElementsByType('vehicle')) do
setElementLighting(v, 10)
end
end)

See Also

Element Functions