Attempt To Call Missing Method 'Play' Of Table Error

So I’m trying to make something that will play all the tweens in a table at once but it’s throwing me errors, any help?

Continue.MouseButton1Down:Connect(function()
	for number, play in pairs(tableTweens) do
		local Tween16 = play
		Tween16:Play()
	end
end)

You haven’t told us what the table is. Also why are you making a copy of a variable you already have? Tween16 will just be the same as play.

Is tableTweens filled with Tween instances? i.e.

local inst1 = Tween:Create(...);
local inst2 = Tween:Create(...);
local tableTweens = {};
table.insert(tableTweens,inst1);
table.insert(tableTweens,inst2);

If not then you can’t simply call Play() on them.

Here’s the table: local tableTweens ={ {Tween8}, {Tween9}, {Tween10}, {Tween11}, {Tween12}, {Tween13}, {Tween15}, }

Continue.MouseButton1Down:Connect(function()
	for number, play in pairs(tableTweens) do
		local Tween16 = play[1]
		Tween16:Play()
	end
end)

should work

Wait but how does it work? Could you explain it? Like I know it’s something to do with play[1].

so your table is { {Tween8}, {Tween9}, {Tween10}, {Tween11}, {Tween12}, {Tween13}, {Tween15}, }
in your loop, play is an array containing your tween ({Tween}). to play your tween, you need to index the first value of the array using [1] which is your tween to use :Play()

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.