2015-01-13 12:52:22 +00:00
|
|
|
function trigger(objectToChange)
|
2015-01-13 16:50:15 +00:00
|
|
|
if(not level) then
|
|
|
|
print("No level found in Lua!")
|
2015-01-13 12:52:22 +00:00
|
|
|
return
|
2015-01-13 16:21:15 +00:00
|
|
|
end
|
2015-01-13 16:50:15 +00:00
|
|
|
if(not physics) then
|
|
|
|
print("No physics found in Lua!")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
a = level:getObjectCount()
|
2015-01-13 12:52:22 +00:00
|
|
|
rand = math.random(0, a - 1)
|
2015-01-13 16:50:15 +00:00
|
|
|
level:deleteObject(rand)
|
2015-01-13 12:52:22 +00:00
|
|
|
print("Triggered from Lua!")
|
|
|
|
end
|