You can write your topic however you want, but you need to answer these questions:
I have an issue where I’m currently trying to create a blood bar with an attribute on the character, but even though the script has no errors, the health bar ui still wont change when the blood attribute has changed. This is a local script under a gui script. Can someone help me figure out the issue to this?
https://gyazo.com/151976357d3021e6588a511308048468
local TweenService = game:GetService("TweenService")
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local HealthBarGui = Player.PlayerGui:WaitForChild("HealthBar")
local HealthBar = HealthBarGui.Border
local HealthProgress = HealthBar.Bar
local FastTween = TweenInfo.new(0.25, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local SlowTween = TweenInfo.new(0.4, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
function UpdateHealthBar()
TweenService:Create(HealthProgress, FastTween, {Size = UDim2.new(Character:GetAttribute("Blood") / Character:GetAttribute("MaxBlood") , 0, 1, 0)}):Play()
print("Yo")
end
local function updated()
local blood = Character:GetAttribute("Blood")
end
Humanoid:GetAttributeChangedSignal("Blood"):Connect(UpdateHealthBar)
Humanoid:GetAttributeChangedSignal("MaxBlood"):Connect(UpdateHealthBar)
UpdateHealthBar()