Advertisement
Slopeh

Untitled

Dec 12th, 2023
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. function disposeMines() local function alert(msg) PreventionSystem.ShowMessage(msg, 4.0) end local ents = Game.GetEntityList(); local nMine, triggerMines = 0, false; for i, mine in ipairs(ents) do local name = mine:GetClassName().value; if string.find(name, 'ExplosiveTriggerDevice') then if triggerMines then nMine = nMine + 1; mine:StartExplosionPipeline(nil) mine:Explode(nil, nil) else nMine = nMine + 1; mine:TurnOffDevice() mine:Dispose() end end end if triggerMines then if nMine == 0 then local msg = 'NO MINES FOUND.'; alert(msg) print(' \n\t'..msg..'\n ') else local msg = 'TRIGGERED '..nMine..' MINE/s'; alert(msg) print(' \n\t'..msg..'\n ') end else if nMine == 0 then local msg = 'NO MINES FOUND.'; alert(msg) print(' \n\t'..msg..'\n ') else local msg = 'REMOVED '..nMine..' MINE/s.'; alert(msg) print(' \n\t'..msg..'\n ') end end end disposeMines()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement