2015-03-02 16:20:02 +00:00
|
|
|
local global = require( "global" )
|
|
|
|
if(global.triggeredOpenSecondDoor1 == nil) then
|
|
|
|
global.triggeredOpenSecondDoor1 = false
|
|
|
|
end
|
2015-03-04 13:35:14 +00:00
|
|
|
if(global.triggeredOpenSecondDoor1Undo == nil) then
|
|
|
|
global.triggeredOpenSecondDoor1Undo = true
|
|
|
|
end
|
|
|
|
|
2015-03-02 16:20:02 +00:00
|
|
|
function trigger(objectToChange)
|
|
|
|
if(global.triggeredOpenSecondDoor1 == false) then
|
|
|
|
if(not level) then
|
|
|
|
print("No level found in Lua!")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
if(global.openSecondDoorCounter == nil) then
|
|
|
|
global.openSecondDoorCounter = 0
|
|
|
|
end
|
|
|
|
if(global.openSecondDoorCounter == 0) then
|
|
|
|
global.openSecondDoorCounter = global.openSecondDoorCounter + 1
|
|
|
|
end
|
|
|
|
global.triggeredOpenSecondDoor1 = true
|
|
|
|
|
|
|
|
if(global.triggeredOpenSecondDoor1 == true and global.triggeredOpenSecondDoor2 == true and global.triggeredOpenSecondDoor3 == true and global.triggeredOpenSecondDoor4 == true) then
|
2015-03-04 17:10:49 +00:00
|
|
|
global.triggeredOpenSecondDoor1Undo = false
|
2015-03-02 16:20:02 +00:00
|
|
|
end
|
|
|
|
|
2015-03-07 12:41:35 +00:00
|
|
|
local xPos = -6.5
|
|
|
|
local yPos = 25.0
|
|
|
|
local zPos = 54.5
|
|
|
|
level:preloadLightPosition(xPos, yPos, zPos)
|
|
|
|
level:addLightByParameters(0.2, 0.9, 0.0, 4.0, -1.5, 3.0, 0.8)
|
2015-03-02 16:20:02 +00:00
|
|
|
print("openSecondDoor1")
|
|
|
|
end
|
|
|
|
end
|
2015-03-04 13:35:14 +00:00
|
|
|
|
|
|
|
function triggerUndo(objectToChange)
|
|
|
|
if(global.triggeredOpenSecondDoor1Undo == false) then
|
|
|
|
if(not level) then
|
|
|
|
print("No level found in Lua!")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
global.openSecondDoorCounter = 0
|
|
|
|
global.triggeredOpenSecondDoor1 = false
|
|
|
|
global.triggeredOpenSecondDoor2 = false
|
|
|
|
global.triggeredOpenSecondDoor3 = false
|
|
|
|
global.triggeredOpenSecondDoor4 = false
|
2015-03-07 12:41:35 +00:00
|
|
|
level:deleteFourLights()
|
2015-03-04 13:35:14 +00:00
|
|
|
|
|
|
|
global.triggeredOpenSecondDoor1Undo = true
|
|
|
|
print("openSecondDoor1Undo")
|
|
|
|
end
|
|
|
|
end
|