FxAddDebris: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
(6 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
[[Image:Fxdebris.png|thumb|200px|Debris]] | |||
Creates a debris particle effect (e.g. bits that fly off a car when ramming a wall). | Creates a debris particle effect (e.g. bits that fly off a car when ramming a wall). | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool fxAddDebris ( float posX, float posY, float posZ, | bool fxAddDebris ( float posX, float posY, float posZ [, int colorR = 255, int colorG = 0, int colorB = 0, int colorA = 255, float scale = 1.0, int count = 1 ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[Effect]].addDebris}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 13: | Line 14: | ||
===Optional Arguments=== | ===Optional Arguments=== | ||
{{OptionalArg}} | |||
*'''colorR, colorG, colorB, colorA:''' the color and alpha (transparency) of the debris effect. | *'''colorR, colorG, colorB, colorA:''' the color and alpha (transparency) of the debris effect. | ||
*'''scale:''' the size of the chunks. | *'''scale:''' the size of the chunks. | ||
*'''count:''' the number of chunks to create. | *'''count:''' the number of chunks to create. | ||
===Returns=== | |||
Returns a true if the operation was successful, false otherwise. | |||
==Example== | |||
<section name="Client" class="client" show="true"> | |||
This example will create a Debris Effect next to you when typing ''/debris'' in the Chatbox. | |||
<syntaxhighlight lang="lua"> | |||
addCommandHandler("debris", function() | |||
local x, y, z = getElementPosition(localPlayer) | |||
local randomColor, randomAmount = math.random(0, 255), math.random(4, 8) | |||
fxAddDebris(x, y, z, randomColor, randomColor, randomColor, 255, 1.0, randomAmount) | |||
end) | |||
</syntaxhighlight> | |||
</section> | |||
==See Also== | ==See Also== | ||
{{Client Effects functions}} | {{Client Effects functions}} |
Latest revision as of 10:00, 21 June 2019
Creates a debris particle effect (e.g. bits that fly off a car when ramming a wall).
Syntax
bool fxAddDebris ( float posX, float posY, float posZ [, int colorR = 255, int colorG = 0, int colorB = 0, int colorA = 255, float scale = 1.0, int count = 1 ] )
OOP Syntax Help! I don't understand this!
- Method: Effect.addDebris(...)
Required Arguments
- posX, posY, posZ: the world coordinates where the debris originates.
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.
- colorR, colorG, colorB, colorA: the color and alpha (transparency) of the debris effect.
- scale: the size of the chunks.
- count: the number of chunks to create.
Returns
Returns a true if the operation was successful, false otherwise.
Example
Click to collapse [-]
ClientThis example will create a Debris Effect next to you when typing /debris in the Chatbox.
addCommandHandler("debris", function() local x, y, z = getElementPosition(localPlayer) local randomColor, randomAmount = math.random(0, 255), math.random(4, 8) fxAddDebris(x, y, z, randomColor, randomColor, randomColor, 255, 1.0, randomAmount) end)
See Also
- createEffect
- fxAddBlood
- fxAddBulletImpact
- fxAddBulletSplash
- fxAddDebris
- fxAddFootSplash
- fxAddGlass
- fxAddGunshot
- fxAddPunchImpact
- fxAddSparks
- fxAddTankFire
- fxAddTyreBurst
- fxAddWaterHydrant
- fxAddWaterSplash
- fxAddWood
- getEffectDensity
- getEffectSpeed
- setEffectDensity
- setEffectSpeed