print("sewageofdeath init") require "lua/entity.lua" require "lua/utilities.lua" sounds = object("Sounds") myTime = 0 timer = 0 moving = false movementLength = 5 originalPosition = { position() } function waitToGoUp() --print("waitToGoUp") if trigger.received(1) then goUp() end end function goUp() --print("goUp") sounds.trigger.send(1,"WarningGong") translateSmooth( originalPosition[1] , originalPosition[2] , originalPosition[3]+ft2m(32) , movementLength , 0.5 , 0.5) sounds.trigger.send(1,"SewageStart_Up") timer = myTime + movementLength + 0.5 currentBehavior = waitToGoDown end function waitToGoDown() --print("waitToGoDown") if myTime >= timer then currentBehavior = goDown end end function goDown() --print("goDown") translateSmooth( originalPosition[1] , originalPosition[2] , originalPosition[3] , movementLength , 0.5 , 0.5) currentBehavior = waitToReset end function waitToReset() --print("waitToReset") if myTime >= ( timer + ( movementLength / 2 ) + 0.5 ) and not playedDownSound then --print("playing down sound") playedDownSound = true sounds.trigger.send(1,"SewageStart_Down") end if myTime >= timer + movementLength then currentBehavior = waitToGoUp playedDownSound = false end end currentBehavior = waitToGoUp while tick() do --print(position()) myTime = myTime + dt currentBehavior() end