#Making a Health Circle thing like in The Forest

1 messages · Page 1 of 1 (latest)

glossy crescent
#

I'm trying to do this circle health thing that I thought it was cool, but I realized that I suck at it, so I'm here to ask for help, so help me please.

glossy crescent
#

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")

local UI = script.Parent

local MainFrame = UI.MainUIFrame
local Background = MainFrame.Background

local Center = Background.Center
local CenterImage = Center.PlayerImage

local LifeCircleFrame = Background.Life
local StaminaCircleFrame = Background.Stamina

local LifeCircle = LifeCircleFrame.Circle
local StaminaCircle = StaminaCircleFrame.Circle

local Percentage = Instance.new("NumberValue")

Percentage:GetPropertyChangedSignal("Value"):Connect(function()
    local Rotation = math.floor(math.clamp(Percentage.Value * 3.6, 0, 360))
    
    LifeCircle.UIGradient.Rotation = math.clamp(Rotation, 0, 180)
end)

Humanoid.HealthChanged:Connect(function(Damage)
    TweenService:Create(Percentage, TweenInfo.new(1, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Value = Damage}):Play()
end)

here it is the script

fresh umbra
#

the percentage is being set to the damage value

#

not an actual percentage

#

im assuming percentage here would mean the percentage of the current health and max health

#

what is with the reaction 💀

glossy crescent
#

but like

#

how could i make this

fresh umbra
#

currentHealth/maxHealth