2015-03-04 14:52:28 +00:00
|
|
|
local global = require( "global" )
|
|
|
|
if(global.triggeredResetPlayer == nil) then
|
|
|
|
global.triggeredResetPlayer = false
|
|
|
|
end
|
2015-03-05 17:30:50 +00:00
|
|
|
|
2015-03-04 14:52:28 +00:00
|
|
|
function trigger(objectToChange)
|
|
|
|
if(global.triggeredResetPlayer == false) then
|
|
|
|
if(not level) then
|
|
|
|
print("No level found in Lua!")
|
|
|
|
return
|
|
|
|
end
|
2015-03-05 17:30:50 +00:00
|
|
|
|
2015-03-04 17:10:49 +00:00
|
|
|
if(global.triggeredOpenFirstDoor == true) then
|
|
|
|
if(global.openedSecondDoor == true) then
|
|
|
|
if(global.triggeredOpenThirdDoor == true) then
|
|
|
|
level:movePlayer(-169.5,22.5,58.5)
|
|
|
|
else
|
|
|
|
level:movePlayer(-78.5,22.5,4.5)
|
|
|
|
end
|
|
|
|
else
|
|
|
|
level:movePlayer(17.5,22.5,87.0)
|
|
|
|
end
|
|
|
|
else
|
|
|
|
level:resetPlayer()
|
|
|
|
end
|
2015-03-04 14:52:28 +00:00
|
|
|
|
|
|
|
print("reset player")
|
|
|
|
end
|
|
|
|
end
|