Tweens will not work

I want the script to look into this folder, which is inside a model labeled with the variable “map”:

image

It would look into the folder and for every part named “FloatUpBeforeDrop”, it would tween the object to, of course, float up. It would also rotate the object a bit and make it look as if the object were being sucked from the ground into a black hole (but slowly). Then half a second later, it would do the same thing for objects named “FloatUpBeforeDrop2”. Then lastly, it would do the “FloatUpBeforeDrop3” and “FloatUpBeforeDrop4” separately because they are single objects. I looked at the code many times but don’t see anything wrong with it.

local FloatUpBeforeDropFunc = coroutine.wrap(function()
	local FloatUpTweenInfo = TweenInfo.new(10, Enum.EasingStyle.Quart, Enum.EasingDirection.In)
	
	for i, instance in pairs(map.FloatUpBeforeDropObjects:GetDescendants()) do
		if instance.Name == "FloatUpBeforeDrop" then
			TS:Create(instance, SpinUpTweenInfo, {CFrame = instance.CFrame * CFrame.new(0, 40, 0) * CFrame.Angles(math.rad(360), 0, math.rad(-60))}):Play()
		end
	end
	
	wait(0.5)
	
	for i, instance in pairs(map.FloatUpBeforeDropObjects:GetDescendants()) do
		if instance.Name == "FloatUpBeforeDrop2" then
			TS:Create(instance, SpinUpTweenInfo, {CFrame = instance.CFrame * CFrame.new(0, 40, 0) * CFrame.Angles(math.rad(360), math.rad(-20), math.rad(-60))}):Play()
		end
	end
	
	wait(1.2)
	local FUBD3 = map.FloatUpBeforeDropObjects.FloatUpBeforeDrop3
	TS:Create(instance, SpinUpTweenInfo, {CFrame = instance.CFrame * CFrame.new(0, 40, 0) * CFrame.Angles(math.rad(360), math.rad(-20), math.rad(-60))}):Play()
	wait(0.7)
	local FUBD4 = map.FloatUpBeforeDropObjects.FloatUpBeforeDrop4
	TS:Create(instance, SpinUpTweenInfo, {CFrame = instance.CFrame * CFrame.new(0, 40, 0) * CFrame.Angles(math.rad(360), 0, math.rad(60))}):Play()
end)

Here’s a video on what is happening (The box I’m standing on is the union I’m tweening)

How do I fix this?

Are you firing the thread?, with coroutine.wrap, you need to call it like a function, like so:

local thread = coroutine.wrap(example) -- creates the thread

thread() -- fires the thread

If the code worked before, make sure you are creating a new thread because you cannot resume a dead coroutine