I've tried to figure this out many times and I just can't seem to do it. I know that this code below:
part = script.Parent for i = 1,10,1 do part.Size = Vector3.new(part.Size.X + 1,part.Size.Y,part.Size.Z) wait(0.1) end
-changes the size of the part but it changes in the direction of negative X and positive X, but I just want it to change only on the direction of positive X. How could I do that?
local Part = script.Parent local AddNumber = 1 --The amount of studs added in each loop. local SizeAddition = 10 --How many times the script adds "AddNumber". for i = 1,SizeAddition do wait() Part.Size = Vector3.new(Part.Size.X + AddNumber,Part.Size.Y,Part.Size.Z) Part.CFrame = Part.CFrame - Vector3.new(AddNumber/2,0,0) end
I think this is what you are looking for.
The following method will work:
local part = script.Parent for i = 1, 10 do -- u dont need the "1" after the 10, because it already goes up by ones without that part.Size = part.Size + Vector3.new(1, 0, 0) -- so here you are making the Size of the part the same, but just adding to the x, or y, or the z axis, this adds 1 stud every 1/30 seconds to the x axis wait() -- wait() is the least wait you can have in a server script which is also equivalent to wait(1/30) end
Hope it helped :)