I know what you're talking about. Here's the script:
Game.Players.PlayerAdded:Wait()
While true do
local StartingSize = script.Parent.Size
wait()
script.Parent.Size = Script.Parent.Size + Vector3.new(0, 1, 0)
local ChangedSize = script.Parent.Size - PartSize
script.Parent.Position = Vector3.new(ChangedSize / 2)
end
So if you just want the part to expand on one side, you have to change the part's position. Also, if you wanna change the size of the part, use Vector3.new (line 6).
At line 8, I divided the difference of the size by 2, because in Roblox, normally, when you change the size of a part, the size will split up equally and add on both directions of the axis.
Example: if you expand a part's size by Vector3.new(0, 1, 0), if will expand on both sides of the Y-axis by 0.5.
Here's the script in clean version:
Game.Players.PlayerAdded:Wait()
While true do
local StartingSize = script.Parent.Size
wait()
script.Parent.Size = Script.Parent.Size + Vector3.new(0, 1, 0)
local ChangedSize = script.Parent.Size - PartSize
script.Parent.Position = Vector3.new(ChangedSize / 2)
end
Hope this helped!
I'm sure it will work, try it.
3 comments
First of all, this is a very inefficient way of creating movement. It is much better to use TweenService. And it seems like you will have to reposition it as you scale it
I dont think this will work because a part size comes in vector3. Note
Try mah answer