Updated currently unused scripts.
This commit is contained in:
parent
a20a55dc79
commit
7ad9965c74
@ -1,14 +1,15 @@
|
||||
if(triggeredDeleteObject == nil) then
|
||||
triggeredDeleteObject = false
|
||||
local global = require( "global" )
|
||||
if(global.triggeredDeleteObject == nil) then
|
||||
global.triggeredDeleteObject = false
|
||||
end
|
||||
function trigger(objectToChange)
|
||||
if(triggeredDeleteObject == false) then
|
||||
if(global.triggeredDeleteObject == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
return
|
||||
end
|
||||
level:deleteObject(objectToChange)
|
||||
triggeredDeleteObject = true
|
||||
global.triggeredDeleteObject = true
|
||||
print("deleteObject")
|
||||
end
|
||||
end
|
||||
|
@ -1,8 +1,9 @@
|
||||
if(triggeredDeleteRandomObject == nil) then
|
||||
triggeredDeleteRandomObject = false
|
||||
local global = require( "global" )
|
||||
if(global.triggeredDeleteRandomObject == nil) then
|
||||
global.triggeredDeleteRandomObject = false
|
||||
end
|
||||
function trigger(objectToChange)
|
||||
if(triggeredDeleteRandomObject == false) then
|
||||
if(global.triggeredDeleteRandomObject == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
return
|
||||
@ -10,7 +11,9 @@ function trigger(objectToChange)
|
||||
a = level:getObjectCount()
|
||||
rand = math.random(0, a - 1)
|
||||
level:deleteObject(rand)
|
||||
triggeredDeleteRandomObject = true
|
||||
global.triggeredDeleteRandomObject = true
|
||||
print("deleteRandomObject")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
@ -1,18 +1,19 @@
|
||||
if(triggeredOpenDoor1 == nil) then
|
||||
triggeredOpenDoor1 = false
|
||||
local global = require( "global" )
|
||||
if(global.triggeredOpenDoor1 == nil) then
|
||||
global.triggeredOpenDoor1 = false
|
||||
end
|
||||
function trigger(objectToChange)
|
||||
if(triggeredOpenDoor1 == false) then
|
||||
if(global.triggeredOpenDoor1 == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
return
|
||||
end
|
||||
|
||||
if(not openDoorCounter) then
|
||||
openDoorCounter = 0
|
||||
if(not global.openDoorCounter) then
|
||||
global.openDoorCounter = 0
|
||||
end
|
||||
openDoorCounter = openDoorCounter + 1
|
||||
if (openDoorCounter == 3) then
|
||||
global.openDoorCounter = global.openDoorCounter + 1
|
||||
if (global.openDoorCounter == 3) then
|
||||
local strength = 1
|
||||
local xPos = 0
|
||||
local yPos = 0
|
||||
@ -20,9 +21,9 @@ function trigger(objectToChange)
|
||||
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
||||
print("Opening the door")
|
||||
end
|
||||
triggeredOpenDoor1undo = false
|
||||
global.triggeredOpenDoor1undo = false
|
||||
|
||||
triggeredOpenDoor1 = true
|
||||
global.triggeredOpenDoor1 = true
|
||||
print("openDoor1")
|
||||
end
|
||||
end
|
||||
|
@ -1,19 +1,20 @@
|
||||
if(triggeredOpenDoor1undo == nil) then
|
||||
triggeredOpenDoor1undo = false
|
||||
local global = require( "global" )
|
||||
if(global.triggeredOpenDoor1undo == nil) then
|
||||
global.triggeredOpenDoor1undo = true
|
||||
end
|
||||
function trigger(objectToChange)
|
||||
if(triggeredOpenDoor1undo == false) then
|
||||
if(global.triggeredOpenDoor1undo == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
return
|
||||
end
|
||||
|
||||
if(triggeredOpenDoor1) then
|
||||
openDoorCounter = openDoorCounter - 1
|
||||
triggeredOpenDoor1 = false
|
||||
if(global.triggeredOpenDoor1) then
|
||||
global.openDoorCounter = global.openDoorCounter - 1
|
||||
global.triggeredOpenDoor1 = false
|
||||
end
|
||||
|
||||
triggeredOpenDoor1undo = true
|
||||
global.triggeredOpenDoor1undo = true
|
||||
print("openDoor1undo")
|
||||
end
|
||||
end
|
||||
|
@ -1,18 +1,19 @@
|
||||
if(triggeredOpenDoor2 == nil) then
|
||||
triggeredOpenDoor2 = false
|
||||
local global = require( "global" )
|
||||
if(global.triggeredOpenDoor2 == nil) then
|
||||
global.triggeredOpenDoor2 = false
|
||||
end
|
||||
function trigger(objectToChange)
|
||||
if(triggeredOpenDoor2 == false) then
|
||||
if(global.triggeredOpenDoor2 == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
return
|
||||
end
|
||||
|
||||
if(not openDoorCounter) then
|
||||
openDoorCounter = 0
|
||||
if(not global.openDoorCounter) then
|
||||
global.openDoorCounter = 0
|
||||
end
|
||||
openDoorCounter = openDoorCounter + 1
|
||||
if (openDoorCounter == 3) then
|
||||
global.openDoorCounter = global.openDoorCounter + 1
|
||||
if (global.openDoorCounter == 3) then
|
||||
local strength = 1
|
||||
local xPos = 0
|
||||
local yPos = 0
|
||||
@ -20,9 +21,9 @@ function trigger(objectToChange)
|
||||
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
||||
print("Opening the door")
|
||||
end
|
||||
triggeredOpenDoor2undo = false
|
||||
global.triggeredOpenDoor2undo = false
|
||||
|
||||
triggeredOpenDoor2 = true
|
||||
global.triggeredOpenDoor2 = true
|
||||
print("openDoor2")
|
||||
end
|
||||
end
|
||||
|
@ -1,19 +1,20 @@
|
||||
if(triggeredOpenDoor2undo == nil) then
|
||||
triggeredOpenDoor2undo = false
|
||||
local global = require( "global" )
|
||||
if(global.triggeredOpenDoor2undo == nil) then
|
||||
global.triggeredOpenDoor2undo = true
|
||||
end
|
||||
function trigger(objectToChange)
|
||||
if(triggeredOpenDoor2undo == false) then
|
||||
if(global.triggeredOpenDoor2undo == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
return
|
||||
end
|
||||
|
||||
if(triggeredOpenDoor2) then
|
||||
openDoorCounter = openDoorCounter - 1
|
||||
triggeredOpenDoor2 = false
|
||||
if(global.triggeredOpenDoor2) then
|
||||
global.openDoorCounter = global.openDoorCounter - 1
|
||||
global.triggeredOpenDoor2 = false
|
||||
end
|
||||
|
||||
triggeredOpenDoor2undo = true
|
||||
global.triggeredOpenDoor2undo = true
|
||||
print("openDoor2undo")
|
||||
end
|
||||
end
|
||||
|
@ -1,18 +1,19 @@
|
||||
if(triggeredOpenDoor3 == nil) then
|
||||
triggeredOpenDoor3 = false
|
||||
local global = require( "global" )
|
||||
if(global.triggeredOpenDoor3 == nil) then
|
||||
global.triggeredOpenDoor3 = false
|
||||
end
|
||||
function trigger(objectToChange)
|
||||
if(triggeredOpenDoor3 == false) then
|
||||
if(global.triggeredOpenDoor3 == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
return
|
||||
end
|
||||
|
||||
if(not openDoorCounter) then
|
||||
openDoorCounter = 0
|
||||
if(not global.openDoorCounter) then
|
||||
global.openDoorCounter = 0
|
||||
end
|
||||
openDoorCounter = openDoorCounter + 1
|
||||
if (openDoorCounter == 3) then
|
||||
global.openDoorCounter = global.openDoorCounter + 1
|
||||
if (global.openDoorCounter == 3) then
|
||||
local strength = 1
|
||||
local xPos = 0
|
||||
local yPos = 0
|
||||
@ -20,9 +21,9 @@ function trigger(objectToChange)
|
||||
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
||||
print("Opening the door")
|
||||
end
|
||||
triggeredOpenDoor3undo = false
|
||||
global.triggeredOpenDoor3undo = false
|
||||
|
||||
triggeredOpenDoor3 = true
|
||||
global.triggeredOpenDoor3 = true
|
||||
print("openDoor3")
|
||||
end
|
||||
end
|
||||
|
@ -1,19 +1,20 @@
|
||||
if(triggeredOpenDoor3undo == nil) then
|
||||
triggeredOpenDoor3undo = false
|
||||
local global = require( "global" )
|
||||
if(global.triggeredOpenDoor3undo == nil) then
|
||||
global.triggeredOpenDoor3undo = false
|
||||
end
|
||||
function trigger(objectToChange)
|
||||
if(triggeredOpenDoor3undo == false) then
|
||||
if(global.triggeredOpenDoor3undo == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
return
|
||||
end
|
||||
|
||||
if(triggeredOpenDoor3) then
|
||||
openDoorCounter = openDoorCounter - 1
|
||||
triggeredOpenDoor3 = false
|
||||
if(global.triggeredOpenDoor3) then
|
||||
global.openDoorCounter = global.openDoorCounter - 1
|
||||
global.triggeredOpenDoor3 = false
|
||||
end
|
||||
|
||||
triggeredOpenDoor3undo = true
|
||||
global.triggeredOpenDoor3undo = true
|
||||
print("openDoor3undo")
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user