--L1_Hallway_Start-- Loading = {} NextLoad = {} loadFlag = false loadFlag2 = false ---Loading State----- Loading["Enter"] = function(scene) tank = GAME():GetSceneSystem():GetCurrentScene():FindActor("Tank") if tank then tank:SetTranslation(0.0, 1.0, 2.0) end end Loading["Update"] = function(scene) if loadFlag == false then print("Enterting Start Function") if GAME():GetSceneSystem():GetIsLoading() == false then GAME():GetSceneSystem():Load("L1_MineShaft.xml") loadFlag = true else print("[Lua] Scene system is busy") end end if GAME():GetSceneSystem():GetIsLoading() == false then print("[Lua] Trying to change state...") scene:GetStateMachine():ChangeState(NextLoad) print("[Lua] Leaving this state. Entering NextLoad State") end end Loading["Exit"] = function(scene) end NextLoad["Enter"] = function(scene) if loadFlag2 == false then print("Entering Start Function") if GAME():GetSceneSystem():GetIsLoading() == false then GAME():GetSceneSystem():Load("L1_Elevator.xml") loadFlag2 = true else print("[Lua] Scene system is busy") end end end NextLoad["Update"] = function(scene) end NextLoad["Exit"] = function(scene) end