Індикатор встановленої висоти стрибка

Додай Part, при дотику до якого у гравця збільшуватиметься висота стрибка. В Part додай наступний скрипт:

local platform = script.Parent

platform.Touched:Connect(function(hit)
local character = hit.Parent
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.JumpHeight += 100
platform:Destroy()
wait(10)
humanoid.JumpHeight -= 100
end
end)

1. Створення GUI (те саме):

У StarterGui:

  • Додай ScreenGui

  • Всередині — Frame з назвою JumpHeightBackground

    • Розмір: UDim2.new(0, 200, 0, 20)

    • Позиція: UDim2.new(0.5, -100, 0.85, 0)

    • Колір: сірий

  • Всередині нього — Frame з назвою JumpHeightFill

    • Розмір: UDim2.new(0, 0, 1, 0) — початкове заповнення

    • Колір: зелений


2. Додай LocalScript в JumpHeightBackground:

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local fillBar = script.Parent:WaitForChild("JumpHeightFill") local MAX_JUMP_HEIGHT = 150 -- максимально можливий JumpHeight, для масштабу -- Оновлення прогрес-бара local function updateBar() local currentJumpHeight = humanoid.JumpHeight local percent = math.clamp(currentJumpHeight / MAX_JUMP_HEIGHT, 0, 1) fillBar.Size = UDim2.new(percent, 0, 1, 0) end -- Перше оновлення updateBar() -- Якщо значення змінюється у грі humanoid:GetPropertyChangedSignal("JumpHeight"):Connect(updateBar)

🧪 Результат:

  • Прогрес-бар заповнений відповідно до значення Humanoid.JumpHeight.

  • Якщо ти змінюєш JumpHeight (наприклад, через скрипт), індикатор автоматично оновиться.


❗Порада:

Якщо ти в коді гри змінюєш JumpPower, а не JumpHeight, переконайся, що використовуєш Humanoid.UseJumpPower = false, бо Roblox використовує або JumpPower, або JumpHeight, не обидва.