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

How do I create a block that grows bigger over time?

So I've got some code, but it seems like everything I try just breaks. My code is below, any suggestions?

local sP = script.Parent
local pSize = sP.Size
---------------------------
local limit = 10
local start = 0
local timer = .6

function reee()
	while start < limit do
		pSize.x = Vector3.x+1
		pSize.y = Vector3.y+1
		pSize.z = Vector3.z+1
		start = start+1
		wait(timer)
	end
end

reee()

1 answer

✓ Accepted answer

Use tweenservice. For example:

local TweenService = game:GetService("TweenService")
 
local part = workspace.Part -- Replace with part name
 
local goal = {}
goal.Size = Vector3.new(10, 1, 10) -- Replace Vector3.new(10, 1, 10) with the size you want it to be
 
local tweenInfo = TweenInfo.new(5) -- Replace 5 with how long you want the tween to be
 
local tween = TweenService:Create(part, tweenInfo, goal)
 
tween:Play()

1 comment

0

Thank you!

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