How can I make this Part slowly increase in size from (0.3,5,5) until it's (0.3,200,200) without making like a million wait()s?
local a = Instance.new("Part", workspace) a.Shape = "Cylinder" a.Size = Vector3.new (0.3,5,5) --to a.Shape = "Cylinder" a.Size = Vector3.new (0.3,200,200)
Theres two ways of doing this. TweenService or Repeat statements. http://wiki.roblox.com/index.php?title=API:Class/TweenService http://wiki.roblox.com/index.php?title=Loops#Repeat
First Method: TweenService
local TS = game:GetService("TweenService") local a = Instance.new("Part") a.Size = Vector3.new(0.3,5,5) a.Shape = "Cylinder" a.Parent = Workspace local goal = {} goal.Size = Vector.new(0.3,200,200) local TI = TweenInfo.new(5) --// The number is where how much seconds it gets to its goal local tween = TS:Create(a,TI, goal) tween:Play()
TweenService helps you resize your parts in a really smooth manner.
Second Method: Repeat
local a = Instance.new("Part") a.Size = Vector3.new(0.3,5,5) a.Shape = "Cylinder" a.Parent = Workspace local interval = 1 --// Set this to how much you it to change everytime repeat a.Size = Vector3.new(0.3,a.Size.X+interval,a.Size.Z+interval) wait(0.01) --// Set this to whatever until a.Size == Vector3.new(0.3,200,200)
This is a very inefficient way to do it. I don't even know when it stops.
Hopes this helps.