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

How can I make this expand without making like a million waits?

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)

2 comments

0

;/ i dont rlly get this

1 answer

✓ Accepted answer

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.

3 comments

0

for loop is way more efficient then repeat.

0

The TweenService option is the best one imo.

0

i'd use repeat, it isn't very good though

This discussion is preserved as it was. New answers, comments, and votes are closed.