2015-03-02 11:58:34 +00:00
|
|
|
local global = require( "global" )
|
|
|
|
if(global.triggeredOpenThirdDoor == nil) then
|
|
|
|
global.triggeredOpenThirdDoor = false
|
|
|
|
end
|
2015-03-04 13:35:14 +00:00
|
|
|
if(global.triggeredOpenThirdDoorUndo == nil) then
|
|
|
|
global.triggeredOpenThirdDoorUndo = true
|
|
|
|
end
|
|
|
|
|
2015-03-15 17:46:44 +00:00
|
|
|
function trigger(objectToChange, printDebug)
|
2015-03-02 11:58:34 +00:00
|
|
|
if(global.triggeredOpenThirdDoor == false) then
|
|
|
|
if(not level) then
|
|
|
|
print("No level found in Lua!")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
local strength = 100
|
|
|
|
local xPos = -172.5
|
|
|
|
local yPos = 33
|
|
|
|
local zPos = 58.5
|
|
|
|
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
|
|
|
|
|
|
|
global.triggeredOpenThirdDoorUndo = false
|
|
|
|
|
|
|
|
global.triggeredOpenThirdDoor = true
|
2015-03-15 17:46:44 +00:00
|
|
|
if(printDebug) then
|
|
|
|
print("openThirdDoor")
|
|
|
|
end
|
2015-03-02 11:58:34 +00:00
|
|
|
end
|
|
|
|
end
|
2015-03-04 13:35:14 +00:00
|
|
|
|
2015-03-15 17:46:44 +00:00
|
|
|
function triggerUndo(objectToChange, printDebug)
|
2015-03-04 13:35:14 +00:00
|
|
|
if(global.triggeredOpenThirdDoorUndo == false) then
|
|
|
|
if(not level) then
|
|
|
|
print("No level found in Lua!")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
local strength = 100
|
|
|
|
local xPos = -172.5
|
|
|
|
local yPos = 25
|
|
|
|
local zPos = 58.5
|
|
|
|
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
|
|
|
|
|
|
|
global.triggeredOpenThirdDoor = false
|
|
|
|
|
|
|
|
global.triggeredOpenThirdDoorUndo = true
|
2015-03-15 17:46:44 +00:00
|
|
|
if(printDebug) then
|
|
|
|
print("openThirdDoorUndo")
|
|
|
|
end
|
2015-03-04 13:35:14 +00:00
|
|
|
end
|
|
|
|
end
|