local player = script.Parent.Parent.Parent.Parent
local playername = player.Name
local character = game.Workspace:WaitForChild("" .. playername .."")
local humanoid = character:WaitForChild("Humanoid")
local health = script.Parent.Green
local plrhealth = humanoid.Health
local plrmaxhealth = humanoid.MaxHealth
plrmaxhealth = 100
plrhealth = 100
local RunService = game:GetService("RunService")
local e = false
local e2 = 0
RunService.RenderStepped:Connect(function()
if plrhealth < 100 then
local damage = 100 - plrhealth
e = true
repeat
health.Size = UDim2.new(health.Size.X.Scale - 0.007, 0, 0.5, 0)
e2 = e2 + 1
if e2 == damage then
e2 = 0
e = false
end
until e == false
end
end)
Yes, I am making a health GUI. I got an answer on why it had an error with the end at the very end, but it didn't seem to resize the GUI. (Kudos to Raccoonyz for answering it!) So, here I go again with talking about this. I'm using a brick that runs the humanoid:TakeDamage(5) on touching the brick, and when I touch it I get damaged but the green health bar stays the same. (PS. The health bar is 0.7 in scale for X, I am pretty sure X is the length of GUIS.)
Yet again confused,
Narwhal

4 comments
Does it have to be offset? I'd rather it be scale, but I don't know if I change it to scale if it will break?
It will break if you change it to scale.
Nevermind, it will not.
mk thanks!