Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Scale cannot be assigned to?

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)

2 answers

isnt it ....~~~~~~~~~~~~~~~~~ decimalbarsize = script.Parent.Size.X.Scale

3 comments

0

Actually, I'm trying to set the Scale, not set the variable.

0

try script.Parent.Scale.Size.X = decimalbarsize

0

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.

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.