local character local humanoid local root local jumpHeld = false local speedBonus = 0 local smoothedSpeed = 0 -- Переменная для плавных цифр спидометра local BASE_SPEED = 16 local MAX_SPEED = 150 local SPEED_GAIN = 4 local BASE_FOV = 80 local MAX_FOV = 145 local currentTilt = 0 -- --- 1. СОЗДАНИЕ ИНТЕРФЕЙСА --- local screenGui = Instance.new("ScreenGui") screenGui.Name = "BhopHUD" screenGui.ResetOnSpawn = false screenGui.Parent = player:WaitForChild("PlayerGui") -- Спидометр (из твоего рабочего кода) local speedLabel = Instance.new("TextLabel") speedLabel.Size = UDim2.new(0, 200, 0, 50) speedLabel.Position = UDim2.new(0.5, -100, 0.72, 0) speedLabel.BackgroundTransparency = 1 speedLabel.TextColor3 = Color3.fromRGB(255, 255, 255) speedLabel.TextSize = 26 speedLabel.Font = Enum.Font.RobotoMono speedLabel.TextStrokeTransparency = 0 speedLabel.TextStrokeColor3 = Color3.fromRGB(0, 0, 0) speedLabel.Text = "0.0" speedLabel.Parent = screenGui -- ВОТЕРМАРКА В ЛЕВОМ НИЖНЕМ УГЛУ ("ntion") local watermarkLabel = Instance.new("TextLabel") watermarkLabel.Size = UDim2.new(0, 200, 0, 30) watermarkLabel.Position = UDim2.new(0, 15, 1, -15) -- Отступ от левого нижнего края watermarkLabel.AnchorPoint = Vector2.new(0, 1) -- Якорь в левом нижнем углу watermarkLabel.BackgroundTransparency = 1 watermarkLabel.TextColor3 = Color3.fromRGB(220, 220, 220) watermarkLabel.TextSize = 16 watermarkLabel.Font = Enum.Font.SourceSansItalic watermarkLabel.TextStrokeTransparency = 0.3 watermarkLabel.TextStrokeColor3 = Color3.fromRGB(0, 0, 0) watermarkLabel.TextXAlignment = Enum.TextXAlignment.Left watermarkLabel.Text = "ntion" watermarkLabel.Parent = screenGui -- ПЛАВНЫЙ ЗАГРУЗОЧНЫЙ ТЕКСТ ("сделано ntion") local noticeLabel = Instance.new("TextLabel") noticeLabel.Size = UDim2.new(0, 500, 0, 60) noticeLabel.Position = UDim2.new(0.5, -250, 0.35, 0) noticeLabel.BackgroundTransparency = 1 noticeLabel.TextColor3 = Color3.fromRGB(0, 255, 140) noticeLabel.TextSize = 38 noticeLabel.Font = Enum.Font.SourceSansBold noticeLabel.TextTransparency = 1 -- Изначально невидимый noticeLabel.TextStrokeTransparency = 1 noticeLabel.TextStrokeColor3 = Color3.fromRGB(0, 0, 0) noticeLabel.Text = "сделано ntion" noticeLabel.Parent = screenGui -- Безопасный запуск анимации загрузочного текста task.spawn(function() -- Плавное появление for i = 1, 0, -0.05 do if not noticeLabel then return end noticeLabel.TextTransparency = i noticeLabel.TextStrokeTransparency = i task.wait(0.02) end task.wait(3) -- Держим на экране 3 секунды -- Плавное исчезновение for i = 0, 1, 0.05 do if not noticeLabel then return end noticeLabel.TextTransparency = i noticeLabel.TextStrokeTransparency = i task.wait(0.02) end if noticeLabel then noticeLabel:Destroy() end end) local function setupCharacter(char) character = char humanoid = char:WaitForChild("Humanoid") root = char:WaitForChild("HumanoidRootPart") speedBonus = 0 smoothedSpeed = 0 -- Сброс сглаживания при возрождении humanoid.StateChanged:Connect(function(_, newState) if newState == Enum.HumanoidStateType.Landed then speedBonus = math.clamp(speedBonus + SPEED_GAIN, 0, MAX_SPEED - BASE_SPEED) end end) end if player.Character then setupCharacter(player.Character) end player.CharacterAdded:Connect(setupCharacter) player.CameraMode = Enum.CameraMode.LockFirstPerson -- --- 2. ОБРАБОТКА НАЖАТИЙ (АВТОПРЫЖОК + БОМБА) --- UserInputService.InputBegan:Connect(function(input, gameProcessed)if gameProcessed then return end -- Удержание пробела для бхопа if input.KeyCode == Enum.KeyCode.Space then jumpHeld = true -- НАЖАТИЕ НА КЛАВИШУ "E" — БОМБА / ПОДЛЕТ (КАК В КОНЦЕ ВИДЕО) elseif input.KeyCode == Enum.KeyCode.E then if root then -- Создаем эффект безопасного взрыва под ногами local explosion = Instance.new("Explosion") explosion.Position = root.Position - Vector3.new(0, 2.5, 0) explosion.BlastRadius = 0 -- 0, чтобы взрыв не убивал тебя и не ломал постройки на карте explosion.BlastPressure = 0 explosion.Parent = workspace -- ДОБАВЛЕНИЕ ЗВУКА БОМБЫ local bombSound = Instance.new("Sound") bombSound.SoundId = "rbxassetid://12222084" -- ID классического звука взрыва в Roblox bombSound.Volume = 1.0 bombSound.Parent = root bombSound:Play() game:GetService("Debris"):AddItem(bombSound, 2) -- Очищаем звук через 2 секунды -- Считаем вектор полета (берем направление взгляда камеры) local lookDir = camera.CFrame.LookVector -- Импульс: толкает вперед в зависимости от взгляда и резко подкидывает вверх local bombForce = Vector3.new(lookDir.X * 85, 95, lookDir.Z * 85) root.AssemblyLinearVelocity = root.AssemblyLinearVelocity + bombForce -- Сразу набрасываем бонус к скорости бхопа, чтобы инерция не терялась speedBonus = math.clamp(speedBonus + 35, 0, MAX_SPEED - BASE_SPEED) end end end) UserInputService.InputEnded:Connect(function(input) if input.KeyCode == Enum.KeyCode.Space then jumpHeld = false end end) -- --- 3. ОСНОВНОЙ ЦИКЛ СИНХРОНИЗАЦИИ --- RunService:BindToRenderStep("CS2_Bhop", Enum.RenderPriority.Camera.Value + 1, function() if not character or not humanoid or not root then return end -- Логика автопрыжка if jumpHeld and humanoid.FloorMaterial ~= Enum.Material.Air then humanoid:ChangeState(Enum.HumanoidStateType.Jumping) end local moveDir = humanoid.MoveDirection local currentVel = root.AssemblyLinearVelocity local flatVel = Vector3.new(currentVel.X, 0, currentVel.Z) local currentSpeed = flatVel.Magnitude -- ПЛАВНЫЙ НАБОР И СБРОС ЦИФР (Lerp-фильтрация) smoothedSpeed = smoothedSpeed + (currentSpeed - smoothedSpeed) * 0.15 speedLabel.Text = string.format("%.1f", smoothedSpeed) -- Физика стрейфов и Air Acceleration if moveDir.Magnitude > 0 then humanoid.WalkSpeed = BASE_SPEED + speedBonus if humanoid.FloorMaterial == Enum.Material.Air then local AIR_ACCEL = 4.0 local newVel = flatVel + (moveDir * AIR_ACCEL) local targetSpeed = math.max(currentSpeed, BASE_SPEED + speedBonus) if newVel.Magnitude > 0 then newVel = newVel.Unit * targetSpeed end root.AssemblyLinearVelocity = Vector3.new(newVel.X, currentVel.Y, newVel.Z) end else speedBonus = math.max(speedBonus - 1.5, 0) humanoid.WalkSpeed = BASE_SPEED + speedBonus end -- Динамический FOV local targetFOV = BASE_FOV + math.clamp(currentSpeed / MAX_SPEED, 0, 1) * (MAX_FOV - BASE_FOV) camera.FieldOfView = camera.FieldOfView + (targetFOV - camera.FieldOfView) * 0.15 -- Наклоны камеры local rightVector = camera.CFrame.RightVector local strafeDot = rightVector:Dot(moveDir) local targetTilt = math.clamp(strafeDot * 0.1, -0.12, 0.12) currentTilt = currentTilt + (targetTilt - currentTilt) * 0.45 camera.CFrame = camera.CFrame * CFrame.Angles(0, 0, currentTilt) end)