er2.explosion 3
Parameters
Parameter | Type | Description |
---|---|---|
1 | vec3 | The position of the explosion |
2 | float | The maximum damage the explosion can cause. The damage calculation is based by the distance of each objects inside the explosion radius |
3 | float | The maximum penetration capacity against armored vehicles. The value is measured in Millimeters |
4 | float | Explosion radius |
Examples
-- Get the AI soldier running this script
local soldier = myself()
-- Ensure the soldier is alive before proceeding
if soldier and soldier:isAlive() then
-- Wait 5 seconds
sleep(5)
-- Get the soldier's position
local pos = soldier:getPosition()
-- Create an explosion at the soldier's location
er2.explosion(pos, 100, 50, 5)
end