Making a value to size function

I’m trying to make this script where i have a value, if the value is 1, i want the size of a part to be 1 of itself. If the value is 2, i want the size to be dubbled. for 3, trippled, etc.
Does anyone know how i can achieve this?

1 Like

If I understand correctly all you need to do is take the parts size and multiply all the axis of the size with your multiplier number, quite simple:

local size = Vector3.new(part.Size.X * multiplier, part.Size.Y * multiplier, part.Size.Z * multiplier)

you can actually multiply Vector3 values, so instead of multiplying every axis on its own, you can do Part.Size = Part.Size * Multiplier

this isnt exactly what i meant, close but not exactly
if i use this line of code, it just increases in size. i want it to also stay in its position so it just goes up if you understand what i mean

Then it will be

Part.Size = Part.Size * Multiplier
Part.Position = Part.Position + (Part.Size * Vector3.new(0, 0.5, 0))

just a side question, is there also a way to make a part go up for the value?