FxAddWood: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
[[Image:Fxwood.png|thumb|200px|Wood]] | |||
Creates a wood splinter particle effect. | Creates a wood splinter particle effect. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool fxAddWood ( float posX, float posY, float posZ, float dirX, float dirY, float dirZ, | bool fxAddWood ( float posX, float posY, float posZ, float dirX, float dirY, float dirZ [, int count = 1, float brightness = 1.0 ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[Effect]].addWood}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 17: | Line 18: | ||
*'''count:''' the number of splinters to create. | *'''count:''' the number of splinters to create. | ||
*'''brightness:''' the brightness. Ranges from 0 (black) to 1 (normal color). | *'''brightness:''' the brightness. Ranges from 0 (black) to 1 (normal color). | ||
===Returns=== | |||
Returns a true if the operation was successful, false otherwise. | |||
==Example== | |||
<section name="Client" class="client" show="true"> | |||
This example will create a Wood Effect next to you when typing ''/woodfx'' in the Chatbox. | |||
<syntaxhighlight lang="lua"> | |||
addCommandHandler("woodfx", function() | |||
local x, y, z = getElementPosition(localPlayer) | |||
local gz = getGroundPosition(x, y, z) | |||
fxAddWood(x, y, gz+0.4, 0, 0, 0, math.random(3, 6), 0.7) | |||
end) | |||
</syntaxhighlight> | |||
</section> | |||
==See Also== | ==See Also== | ||
{{Client Effects functions}} | {{Client Effects functions}} |
Latest revision as of 09:59, 21 June 2019
Creates a wood splinter particle effect.
Syntax
bool fxAddWood ( float posX, float posY, float posZ, float dirX, float dirY, float dirZ [, int count = 1, float brightness = 1.0 ] )
OOP Syntax Help! I don't understand this!
- Method: Effect.addWood(...)
Required Arguments
- posX, posY, posZ: the world coordinates where the effect originates.
- dirX, dirY, dirZ: a direction vector indicating where the wood splinters fly to.
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- count: the number of splinters to create.
- brightness: the brightness. Ranges from 0 (black) to 1 (normal color).
Returns
Returns a true if the operation was successful, false otherwise.
Example
Click to collapse [-]
ClientThis example will create a Wood Effect next to you when typing /woodfx in the Chatbox.
addCommandHandler("woodfx", function() local x, y, z = getElementPosition(localPlayer) local gz = getGroundPosition(x, y, z) fxAddWood(x, y, gz+0.4, 0, 0, 0, math.random(3, 6), 0.7) end)
See Also
- createEffect
- fxAddBlood
- fxAddBulletImpact
- fxAddBulletSplash
- fxAddDebris
- fxAddFootSplash
- fxAddGlass
- fxAddGunshot
- fxAddPunchImpact
- fxAddSparks
- fxAddTankFire
- fxAddTyreBurst
- fxAddWaterHydrant
- fxAddWaterSplash
- fxAddWood
- getEffectDensity
- getEffectSpeed
- setEffectDensity
- setEffectSpeed