SetElementLighting: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
m (Update note)
Line 3: Line 3:
{{New feature/item|3.0161|1.6.0|22862|This function changes the lighting value for the specified [[element]]. This can be a [[player]], [[ped]], [[vehicle]], [[object]], [[Element/Weapon|weapon]].}}
{{New feature/item|3.0161|1.6.0|22862|This function changes the lighting value for the specified [[element]]. This can be a [[player]], [[ped]], [[vehicle]], [[object]], [[Element/Weapon|weapon]].}}


{{Note|Lighting is calculated in real-time, so you will likely need [[onClientRender]] or [[onClientPreRender]].}}
{{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==
==Syntax==

Revision as of 17:52, 4 January 2025

ADDED/UPDATED IN VERSION 1.6.0 r22862:
This function changes the lighting value for the specified element. This can be a player, ped, vehicle, object, weapon.
[[{{{image}}}|link=|]] 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

bool setElementLighting ( element theElement, float lighting )

OOP Syntax Help! I don't understand this!

Method: element:setLighting(...)
Variable: .lighting
Counterpart: getElementLighting


Required Arguments

  • theElement: The element whose lighting you want to change.
  • lighting: The lighting value that you want to set.

Returns

Returns true if the function was successful, false otherwise. This function can fail if called right after element creation.

Example

Accessories-text-editor.png Script Example Missing Function SetElementLighting needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.


See Also