Saxum/data/levels/scripts/openDoor1.lua

30 lines
882 B
Lua
Raw Normal View History

2015-02-20 12:26:09 +00:00
local global = require( "global" )
if(global.triggeredOpenDoor1 == nil) then
global.triggeredOpenDoor1 = false
end
function trigger(objectToChange)
2015-02-20 12:26:09 +00:00
if(global.triggeredOpenDoor1 == false) then
if(not level) then
print("No level found in Lua!")
return
end
2015-02-20 12:26:09 +00:00
if(not global.openDoorCounter) then
global.openDoorCounter = 0
end
2015-02-20 12:26:09 +00:00
global.openDoorCounter = global.openDoorCounter + 1
if (global.openDoorCounter == 3) then
local strength = 1
local xPos = 0
local yPos = 0
local zPos = 0
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
print("Opening the door")
end
2015-02-20 12:26:09 +00:00
global.triggeredOpenDoor1undo = false
2015-02-20 12:26:09 +00:00
global.triggeredOpenDoor1 = true
print("openDoor1")
end
end