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

How do I fix this script so it works and the parts stretch in different lengths every time?

Asked by 4 years ago

Alright, so i made a script that tweens the part. And I made a thing where the length changes overtime. But it doesn't work.

Here's the code:

local part = script.Parent
local tweenSvr = game:GetService("TweenService")
local length = math.random(2.0, 4.0)

while true do
    length = math.random(2.0, 4.0)
    wait(length)
end

local TweenStats = TweenInfo.new(
    length,
    Enum.EasingStyle.Linear,
    Enum.EasingDirection.Out
    -1,
    true
)

local Goals = {
    Size = Vector3.new(8, 32, 8)
}

local play = tweenSvr:Create(part, TweenStats, Goals)
play:Play()

Answer this question