Gui size changing

im trying to design a script that basically when the player dies it makes a gui bar go down in size by a quarter, but nothing i do will work. does anyone have an idea on how i could do this?

I would use the CharacterAdded function for this kind of thing.
https://create.roblox.com/docs/reference/engine/classes/Player#CharacterAdded

Unless you’re talking about decreasing the bar size, it would be something like;

game["Run Service"].RenderStepped:Connect(function() -- Checks to see when the values change
bar.Size = UDim2.new(currentLives.Value/maxLives.Value,0,1,0)  -- "bar" would be your frame
end)

If the gui size is going the wrong direction, changing its anchor point should fix it.
There is probably a more efficient method out there (Like the reply below me), hope you figure it out

You don’t have to check on every frame to see if the values have changed.

Just use :GetPropertyChangedSignal().

1 Like