Saxum/Levels/scripts/openDoor1.lua

29 lines
777 B
Lua
Raw Normal View History

if(triggeredOpenDoor1 == nil) then
triggeredOpenDoor1 = false
end
function trigger(objectToChange)
if(triggeredOpenDoor1 == false) then
if(not level) then
print("No level found in Lua!")
return
end
if(not openDoorCounter) then
openDoorCounter = 0
end
openDoorCounter = openDoorCounter + 1
if (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
triggeredOpenDoor1undo = false
triggeredOpenDoor1 = true
print("openDoor1")
end
end