OnSiegeEngineDestroyed
A siege engine was wrecked - by another engine’s shots, or by the mode.
Its structure fell to 0 (SetSiegeEngineHealth says how much it has). A wreck stands where it was: nobody can work it until
SetSiegeEngineHealth repairs it, or DestroyEntity removes it. A broken siege ladder lies on the ground in pieces, and
whoever climbed it came down with it.
Syntax
Section titled “Syntax”function OnSiegeEngineDestroyed(id, by) -- ...end| Parameter | Type | |
|---|---|---|
id |
number | the engine |
by |
number | the player whose shot wrecked it; -1 = the mode (SetSiegeEngineHealth with 0) or a shot nobody fired |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”function OnSiegeEngineDestroyed(id, by) if by >= 0 then SendClientMessageToAll(COLOR_YELLOW, GetPlayerName(by) .. " wrecked a " .. GetEntityTemplate(id) .. "!") end SetTimer(function() SetSiegeEngineHealth(id, 100) end, 120000) -- rebuilt two minutes laterendSee also
Section titled “See also”SetSiegeEngineHealth · OnSiegeImpact · the Siege engines group of the index
