- Documentation
- Client events
- onClientExplosion
Event
onClientExplosion
An explosion is about to happen in the player's game. You can cancel it only for yourself.
Handler
addEventHandler("onClientExplosion", root, function(x, y, z, theType) ... end)Parameters
x, y, zfloat- Position.
theTypeint- Type 0-12.
Source
source is the explosion's creator or root.
cancelEvent() = no explosion in this game.
Example
addEventHandler("onClientExplosion", root, function(x, y, z)
if getDistanceBetweenPoints3D(x, y, z, 2495, -1687, 13.5) < 30 then cancelEvent() end
end)
See also
createExplosionCreates an explosion at a spot. On the server every player sees it and it hurts like in the game; on the client the explosion is only in that game (it triggersonClientExplosion, which can cancel it). Types 0-12: 0 grenade, 1 molotov, 2 rocket, 3 weak rocket, 4 car, 5 quick car explosion, 6 boat, 7 helicopter, 8 mine, 9 object, 10 tank shell, 11 small, 12 tiny.onExplosionAn explosion happened (reported by a player's game or from a script).