local player = require("player") local silentRotations = require("silent_rotations_v2") -- Настройки из Java кода local upperBounds = 220 local lowerBounds = 180 local pitchDownTarget = 37.72 local pitchUpTarget = -54.77 -- Скорости изменения угла (согласно комментариям в Java) local speedUp = 5.45 local speedDown = 0.90 -- Состояние local pitchingDown = true local currentPitch = 37.72 -- Функция рандомизации как в Java: (bound * (Math.random() - 0.5)) local function randPitch(pitch, bound) return pitch + (bound * (math.random() - 0.5)) end registerClientTick(function() local position = player.getPosition() if not position then return end -- 1. Логика переключения состояний по высоте if pitchingDown and position.y <= lowerBounds then pitchingDown = false elseif not pitchingDown and position.y >= upperBounds then pitchingDown = true end -- 2. Изменение угла (Pitch) if not pitchingDown then -- Поднимаем нос вверх (Pitch уменьшается) currentPitch = currentPitch - randPitch(speedUp, 1.0) -- Если достигли предела -54.77, начинаем фазу опускания носа if currentPitch < pitchUpTarget then currentPitch = pitchUpTarget pitchingDown = true end elseif currentPitch < pitchDownTarget then -- Опускаем нос вниз (Pitch увеличивается) до 37.72 currentPitch = currentPitch + randPitch(speedDown, 0.5) -- Ограничиваем, чтобы не ушло ниже целевого угла if currentPitch > pitchDownTarget then currentPitch = pitchDownTarget end end -- 3. Применение ротации local rotation = player.getRotation() -- Используем текущий Yaw игрока, чтобы он мог управлять направлением полета silentRotations.rotateToYawPitch(rotation.yaw, currentPitch) silentRotations.update() end)