User Tools

Site Tools


set_entity_light_enabled

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
set_entity_light_enabled [2017/08/11 21:32] – created justinset_entity_light_enabled [2020/05/04 09:33] justin
Line 2: Line 2:
 ---- ----
  
-Enables or disables the light attached to the specified entity (with the assumption that the entity is a light source).+Enables or disables the light attached to the specified [[entity]] (with the assumption that the [[entity]] is a light source).
  
 +====Signature:====
 <code python> <code python>
 set_entity_light_enabled(entity, enabled) set_entity_light_enabled(entity, enabled)
Line 9: Line 10:
  
 ^Argument^Description^Type^Required^ ^Argument^Description^Type^Required^
-|entity|Entity that will have its light enabled or disabled.|[[Entity]]|Yes| +|entity|[[Entity]] that will have its light enabled or disabled.|[[Entity]]|Yes| 
-|enabled|Determines whether the light will be turned on or off.|[[Boolean]]|Yes|+|enabled|Determines the light's state (on or off).|[[Boolean]]|Yes| 
 + 
 +<WRAP center round info 100%> 
 +If you'd like to change the [[color]] of the [[entity|entity's]] light instead of toggling it on or off, see the related [[Set Entity Light Color]] function. 
 +</WRAP>
  
 ====Example:==== ====Example:====
-<code lua>+<code bauxite>
 set_entity_light_enabled(entity["lamp"], false) set_entity_light_enabled(entity["lamp"], false)
 </code> </code>
-//Results:// The entity with an ID of "lamp" will be disabled (i.e. it will be turned off and no longer cast light until turned on again).+//Results:// The [[entity]] with an ID of "lamp" will have its light disabled (i.e. it will be turned off and no longer cast light until turned on again).
  
 <WRAP center round tip 100%> <WRAP center round tip 100%>
-Use the **Set Entity Light Enabled** function to...+Use the **Set Entity Light Enabled** function to toggle a room's light on and off when the player interacts with a switch or button.
 </WRAP> </WRAP>
  
Line 29: Line 34:
  
 <WRAP half column> <WRAP half column>
-====Visual Demo:==== +====Visual Demo:====
 {{:wiki:set_entity_light_enabled_demo.gif?nolink|}} {{:wiki:set_entity_light_enabled_demo.gif?nolink|}}
 </WRAP> </WRAP>
set_entity_light_enabled.txt · Last modified: 2021/04/21 18:50 by justin