fxAddBlood
Client-side
Server-side
Shared
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
Creates a blood splatter particle effect.
OOP Syntax Help! I don't understand this!
- Method: Effect.)(...)
Syntax
bool fxAddBlood ( float posX, float posY, float posZ, float dirX, float dirY, float dirZ, [ int count = 1, float brightness = 1.0 ] )Required Arguments
- posX: MISSING_PARAM_DESC
- posY: MISSING_PARAM_DESC
- posZ: MISSING_PARAM_DESC
- dirX: MISSING_PARAM_DESC
- dirY: MISSING_PARAM_DESC
- dirZ: MISSING_PARAM_DESC
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.
- count (default: 1): the number of flying droplets to create.
- brightness (default: 1.0): the brightness. Ranges from 0 (almost black) to 1 (normal color).
Returns
- bool: value
Code Examples
shared
This example creates blood effects when a player gets shot.
function BloodonDamage( attacker, weapon, bodypart, loss ) if loss > 25 then -- if the player loses more than 25 hp, then... local x, y, z = getElementPosition( source ) -- get player's position for adding blood local randombloodamount = math.random( 1, 3 ) -- random blood amount 1-3 fxAddBlood ( x, y, z-2, 0.00000, 0.00000, 0.00000, randombloodamount, 1 ) -- this adds blood to player's current position endendaddEventHandler( "onClientPlayerDamage", root, BloodonDamage ) -- calls the function when a player loses hp