SetEffectDensity: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
{{Client function}} | {{Client function}} | ||
{{New items|4.0132|1.4 r6208| | {{New items|4.0132|1.4 r6208| | ||
This function sets the density | This function sets the density of a specified [[effect]]. | ||
}} | }} | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool setEffectDensity(effect theEffect, float density) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''theEffect:''' The [[effect]] to change the speed of. | ||
*'''density:''' The level of density. | *'''density:''' The level of density. | ||
===Example=== | ===Example=== | ||
This example adds command ''sed'' that creates spray effect at the player's position and sets its density to 2. | |||
<syntaxhighlight lang="lua">[Lua] | <syntaxhighlight lang="lua">[Lua] | ||
addCommandHandler("sed", | addCommandHandler("sed", | ||
function (cmd) | function (cmd) | ||
local x, y, z = getElementPosition (localPlayer) | local x, y, z = getElementPosition(localPlayer) | ||
local effect = createEffect (" | local effect = createEffect("spraycan", x, y, z) | ||
setEffectDensity(effect, 2) | setEffectDensity(effect, 2) | ||
end) | end) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See also== | ==See also== | ||
{{Client_Effects_functions}} | {{Client_Effects_functions}} | ||
[[ru:setEffectDensity]] | [[ru:setEffectDensity]] |
Revision as of 10:52, 30 June 2014
Syntax
bool setEffectDensity(effect theEffect, float density)
Required Arguments
- theEffect: The effect to change the speed of.
- density: The level of density.
Example
This example adds command sed that creates spray effect at the player's position and sets its density to 2.
[Lua] addCommandHandler("sed", function (cmd) local x, y, z = getElementPosition(localPlayer) local effect = createEffect("spraycan", x, y, z) setEffectDensity(effect, 2) end)