Here’s the code inside the Main local script:
–//Variables
local speeder = script.Parent.Parent.Parent
local humanoid = speeder.Humanoid
local healthGui = script.Parent
–//Health
humanoid:GetPropertyChangedSignal(“Health”):Connect(function()
local healthColor = Color3.fromRGB(255,0,0):Lerp(Color3.fromRGB(85,255,0),humanoid.Health/humanoid.MaxHealth)
local healthChange = humanoid.Health/humanoid.MaxHealth
healthGui.Health.Meter:TweenSize(UDim2.new(healthChange,0,1,0),“In”,“Linear”,1)
healthGui.Health.Meter.BackgroundColor3 = healthColor
end)
Not sure if this will fix it but after the length of time in the TweenSize function, you have to add a true which allows it to be overridden if TweenSize is called on the Meter again healthGui.Health.Meter:TweenSize(UDim2.new(healthChange,0,1,0),“In”,“Linear”,1, true)
Didn’t fix it but could it be because I converted it from a player health GUI to the vehicle health bar? The vehicle doesn’t have any scripts yet it’s just got a humanoid and a health bar GUI
Found the issue, it is size of the BillboardGui. It is set to (1,0,1,0) and once the bar leaves the middle it stops getting rendered. What you can do is set the size of the BillboardGui to (0,560,0,30) and set the Meter Frame size to (1,0,1,0) and set the position of the same frame to (0,0,0,0)