I made a custom health GUI bar and I have a LocalScript in it for it to change it's size depending on when a particular player gets damaged. The issue I have is the bar is extending the actual GUI I made for it and the percentages are way off. Could someone help me? The player has around 5,000 health as opposed to 100.
As you can see in this picture, http://imgur.com/sMEoPxy
the lime green bar is NOT part of what I made in the GUI, I think it is part of my LocalScript. This is what my LocalScript looks like
script:WaitForChild("RemoteEvent")
script.RemoteEvent.OnClientEvent:connect(function()
for i, v in pairs(game.Players:GetChildren()) do
if v.TeamColor == BrickColor.new("Bright red") then
local bosshealth = v.Character.Humanoid.Health
local bossmaxhealth = v.Character.Humanoid.MaxHealth
script.Parent.Size = UDim2.new(bosshealth / bossmaxhealth,0,0,20)
end
end
end)
Please do not worry about why I am using a remoteevent and why I am doing for i, etc. I know why and I THINK it is fine I am just worried about the health bar.

1 comment
0,0,20???