targetOneReached = false targetTwoReached = false time = 0.0 function handleTrigger() helo:moveUp(true) end function invertTargetReached() targetReached = not targetReached end function tick(timestep) time = timestep+time heloYCoord = helo:getAbsCoorY() heloXCoord = helo:getAbsCoorX() heloZCoord = helo:getAbsCoorZ() -- triggerZCoor = heloTrigger:getAbsCoorZ() --io.write(triggerZCoor) --io.write("\n") if heloYCoord < 0 and not targetOneReached then heloYCoord = heloYCoord + 1*timestep else targetOneReached = true end if targetOneReached then heloXCoord = heloXCoord + 10*timestep end if heloXCoord > -1445 then heloYCoord = heloYCoord - 1*timestep heloXCoord = heloXCoord - 8*timestep end if heloXCoord > -1440 then targetTwoReached = true end if heloYCoord < -18 and targetTwoReached then return true; end helo:setAbsCoor(heloXCoord, heloYCoord ,heloZCoord) --if time < 1 and not targetReached then -- handleTrigger() --else -- helo:moveUp(false) --end return false end