clearLights: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Unifying Current Token red link.)
No edit summary
Line 7: Line 7:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
clearLights()
clearLights()
clearLights(id)
clearLights(id, mapname)
</source>
</source>


'''Parameters'''
{{param|id|The token {{code|id}} of the token for which to turn off all light sources, defaults to the [[Current Token]]. {{TrustedParameter}} }}
{{param|mapname|The name of the map to find the token.  Defaults to the current map.}}


|examples=
|examples=
Line 22: Line 27:
[h,foreach(tok, getTokens()), code: { [token(tok): clearLights()]}]
[h,foreach(tok, getTokens()), code: { [token(tok): clearLights()]}]
</source>
</source>
|changes=
{{change|1.5.4|Added {{code|id}} and {{code|mapname}} parameter options.}}


}}
}}
[[Category: Light Function]]
[[Category: Light Function]]

Revision as of 19:54, 16 August 2019

clearLights() Function

Introduced in version 1.3b48
Turns off all of the light sources for the Current Token.

Usage

clearLights()
clearLights(id)
clearLights(id, mapname)

Parameters

  • id - The token id of the token for which to turn off all light sources, defaults to the Current Token.

     Note: This parameter can only be used in a Trusted Macro

  • mapname - The name of the map to find the token. Defaults to the current map.

Examples

To turn off all of the light sources for the current token.
[h: clearLights()]

To turn off all the lights sources on the map you could run the following script, note you will have to be the GM or run it as part of a trusted macro.

Ok Kids lights out!
[h,foreach(tok, getTokens()), code: { [token(tok): clearLights()]}]

Version Changes

  • 1.5.4 - Added id and mapname parameter options.