Saxum/data/levels/scripts/unused/deleteRandomObject.lua

20 lines
534 B
Lua
Raw Normal View History

2015-02-20 12:26:09 +00:00
local global = require( "global" )
if(global.triggeredDeleteRandomObject == nil) then
global.triggeredDeleteRandomObject = false
end
function trigger(objectToChange)
2015-02-20 12:26:09 +00:00
if(global.triggeredDeleteRandomObject == false) then
if(not level) then
print("No level found in Lua!")
return
end
a = level:getObjectCount()
rand = math.random(0, a - 1)
level:deleteObject(rand)
2015-02-20 12:26:09 +00:00
global.triggeredDeleteRandomObject = true
print("deleteRandomObject")
end
end
2015-02-20 12:26:09 +00:00