DCS_MissionDev/DCS_Syria/Battle for Rayak Valley/Remove all objects with specific prefix.lua
2024-12-02 10:01:21 -06:00

9 lines
348 B
Lua

do
local statObj = coalition.getStaticObjects(2) --1 Red coalition 2 blue coalition
for i, static in pairs(statObj) do
local staticName = static:getName()
if string.match(staticName, "Carrierstatics.*") then -- Searches for anything with a name starting with Carrierstatics
static:destroy() -- removes the object
end
end
end