Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago

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()
0
Thank you! Beastlance 22 — 4y
Ad

Answer this question