uh, i made a healthbar script that changes size in comparison to the players health and on the last line above end it says scale cannot be assigned to;
local player = game.Players.LocalPlayer local health = player.Health local Denominator = 100 wait(1) game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false) health.Changed:Connect(function() script.Parent.Frame.TextLabel.Text = health.Value .. " / " .. Denominator script.Parent.Frame.Size.X.Scale = health.Value / 100 end)
You cannot write to individual X/Y values of the Size. The Size is a UDim2 value, and therefore you must construct a new one of such.
local xScale = health.Value / 100 local xOffset = script.Parent.Frame.Size.X.Offset local yScale = script.Parent.Frame.Size.Y.Scale local yOffset = script.Parent.Frame.Size.Y.Offset script.Parent.Frame.Size = UDim2.new(xScale, xOffset, yScale, yOffset)