While I was making a customized health bar, it said "Scale cannot be assigned to", even though it's a property of Frame. Please help. Here's the code:
script.Parent.Size.X.Scale = decimalbarsize
(decimalbarsize = 0.2)
While I was making a customized health bar, it said "Scale cannot be assigned to", even though it's a property of Frame. Please help. Here's the code:
script.Parent.Size.X.Scale = decimalbarsize
(decimalbarsize = 0.2)
isnt it ....~~~~~~~~~~~~~~~~~ decimalbarsize = script.Parent.Size.X.Scale
When you change a property that has multiple variables in it, you have to edit the property as a whole, instead of a specific variable. So in order to change the size or position of a GuiObject, you would have to do this:
local Frame = script.Parent
Frame.Size = UDim2.new(XScale,XOffset,YScale,YOffset) --Replace the words with numbers or variables. Example: UDim2.new(0,25,0,10)
Hope this helped!
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Actually, I'm trying to set the Scale, not set the variable.
try script.Parent.Scale.Size.X = decimalbarsize
The only problem with that is that X consists of two numbers: the Scale, and Offset. I wouldn't be able to put in both numbers.