Im working on a display healthbar on a surfaceGUI.
This is the code that doesn't print after it hits like 1/3rd of the way through.
local barSize = script.Parent.Size
local barC = script.Parent.BackgroundColor3
while wait(1) do
function changeSize()
local player = game.Players.PlayerAdded:connect(function(player)
print("debug 1")
if player.Health ~= 100 then
player.barSize = player.Health * 10
print("debug2")
end
end)
end
end
changeSize()

2 comments
I'm trying to make it change when a player gets hit
I mean your Objects, so that I can assist you in making this work as you expect.