Saxum/data/levels/scripts/resetPlayer.lua

34 lines
1010 B
Lua
Raw Normal View History

local global = require( "global" )
if(global.triggeredResetPlayer == nil) then
global.triggeredResetPlayer = false
end
2015-03-05 17:30:50 +00:00
function trigger(objectToChange)
if(global.triggeredResetPlayer == false) then
if(not level) then
print("No level found in Lua!")
return
end
2015-03-15 17:33:12 +00:00
if(global.triggeredFristCheckpoint == true) then
if(global.triggeredOpenFirstDoor == true) then
if(global.openedSecondDoor == true) then
if(global.triggeredOpenThirdDoor == true) then
level:movePlayer(-169.5,21.5,58.5)
else
level:movePlayer(-78.5,21.75,4.5)
end
else
2015-03-15 17:33:12 +00:00
level:movePlayer(17.5,21.0,87.0)
end
else
2015-03-15 17:33:12 +00:00
level:movePlayer(18.0, 23.0, 145.0)
end
else
level:resetPlayer()
end
print("reset player")
end
end