Tween unable to run more than once

Hi, so I have the folowing script:

local TweenService = game:GetService("TweenService")

Part = script.Parent

local TweenInfoSizeMinus2 = TweenInfo.new(

3, -- Time

Enum.EasingStyle.Quint, -- EasingStyle

Enum.EasingDirection.Out, -- EasingDirection

0, -- RepeatCount (when less than zero the tween will loop)

false,

0 -- DelayTime

)

local PartSize = Part.Size

local goalSizeMin2 = {}

goalSizeMin2.Size = Vector3.new(PartSize.X - 2, PartSize.y, PartSize.X - 2)

local SizeMin2 = TweenService:Create(Part, TweenInfoSizeMinus2, goalSizeMin2)

wait(3)

SizeMin2:Play()

wait(3)

Part.Size = Vector3.new(PartSize.X - 2, PartSize.Y, PartSize.X - 2)

wait(2)

SizeMin2:Play()

wait(3)

Part.Size = Vector3.new(PartSize.X - 2, PartSize.Y, PartSize.X - 2)

now in theoary it should run the tween, set size to 8, 1, 8 then run the tween again. then set the size to 6, 1, 6 (as the original part is 10, 1, 10) yet for some reason it only goes to 8, 1, 8 before stopping the script. (Note I will not use hard coding as it will be ineffective, and the only reason i set the size after is to prevent the script from going 10, 1, 10 to 8, 1, 8 twice)

Note I will NOT accept delaying for ~8 seconds as the wait-in between is just so I can see it more clearly.

Any help?

I know this may sound very stupid, but have you tried doing this

local SizeMin2 = TweenService:Create(Part, TweenInfoSizeMinus2, goalSizeMin2)
local SizeMin3 = TweenService:Create(Part, TweenInfoSIzeMinus2, goalSizeMin2)

wait(3)

SizeMin2:Play()

wait(3)

Part.Size = Vector3.new(PartSize.X - 2, PartSize.Y, PartSize.X - 2)

wait(2)

SizeMin3:Play()

wait(3)

Part.Size = Vector3.new(PartSize.X - 2, PartSize.Y, PartSize.X - 2)

i am aware that this is a Stupid fix but sometimes, the stupidest fixes work

1 Like

You are setting the part size but that doesn’t update goalSizeMin2.Size with new values.
Simply set goalSizeMin2.Size again after changing part.Size and before playing the tween again.