er2.explosion 3

Generates an explosion


Return value

Return TypeDescription
voidThis function doesn't return anything

Parameters

ParameterTypeDescription
1vec3The position of the explosion
2floatThe maximum damage the explosion can cause. The damage calculation is based by the distance of each objects inside the explosion radius
3floatThe maximum penetration capacity against armored vehicles. The value is measured in Millimeters
4floatExplosion 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

Back to Scripting API