Tween at the same time

i want to tween this model but in to this way

i want to achieve like that
i use for i, v in pairs and its not working also i use tween

local model = script.Parent
local ts = game:GetService("TweenService")

for i, v in pairs(model:GetChildren()) do
	
	ts:Create(v, TweenInfo.new(1), {Size = v.Size + Vector3.new(0,-3,0)}):Play()
	wait(1)

end

The script is part of the model, so just make sure it’s a part next time.

local model = script.Parent
local ts = game:GetService("TweenService")

for i,v in pairs(model:GetChildren()) do
	if v:IsA("Part") then
		ts:Create(v, TweenInfo.new(1), {Size = v.Size + Vector3.new(0,-3,0)}):Play()
		wait(1)
	end	
end

its still not tween at the same time

Just move the wait to after the loop…

local model = script.Parent
local ts = game:GetService("TweenService")

for i,v in pairs(model:GetChildren()) do
	if v:IsA("Part") then
		ts:Create(v, TweenInfo.new(1), {Size = v.Size + Vector3.new(0,-3,0)}):Play()
	end	
end
wait(1)
1 Like

Try looking at welds.
(char limit)

If you want it to tween to the top, do this:

local model = script.Parent
local ts = game:GetService("TweenService")

for i,v in pairs(model:GetChildren()) do
	if v:IsA("Part") then
		local SizeChange = 3
		ts:Create(v, TweenInfo.new(1), {Size = v.Size + Vector3.new(0,-SizeChange,0); Position = v.Position + Vector3.new(0,SizeChange/2,0)}):Play()
	end	
end
wait(1)

btw i tried this one but only one part working

btw here’s the script

local model = script.Parent
local ts = game:GetService("TweenService")

for i,v in pairs(model:GetChildren()) do
		while true do
		ts:Create(v, TweenInfo.new(1), {Size = v.Size + Vector3.new(5,5,5)}):Play()
		wait(1)
			ts:Create(v, TweenInfo.new(1), {Size = v.Size + Vector3.new(-5,-5,-5)}):Play()
			wait(1)
	end
end

sorry the vid is lag

Well this code will not loop through all the parts because you have a while true loop inside the for loop as seen right here:

I recommend you switch to something like this:

for i,v in pairs(model:GetChildren()) do
	spawn(function()
		while true do
			ts:Create(v, TweenInfo.new(1), {Size = v.Size + Vector3.new(5,5,5)}):Play()
			wait(1)
			ts:Create(v, TweenInfo.new(1), {Size = v.Size + Vector3.new(-5,-5,-5)}):Play()
			wait(1)
		end
	end)
end
1 Like