- Documentation
- Client functions
- getParticleCount
Function
getParticleCount
Returns the number of living particles of the emitter. An emitter further than maxDistance from the camera computes nothing and returns 0.
Syntax
int getParticleCount(element emitter)Arguments
emitterelement- The emitter.
Returns
The particle count or false.
Example
A counter of all living particles in the screen corner.
addEventHandler("onClientRender", root, function()
local total = 0
for _, emitter in ipairs(getElementsByType("particle")) do
total = total + getParticleCount(emitter)
end
dxDrawText("Cząsteczki: " .. total, 20, 20)
end)
Notes
Client only: every player simulates a server emitter's particles on their own.