Looping through aminations from tables

While recreating my combat, I came across a problem. I am trying to create a combo system when a player clicks, an animation happens, they click again, another animation happens.

As of right now I am trying to loop these through tables. Everytime a player clicks, the table will move through the values. It isn’t working as I expected it to. I have tried removing the tables after player has clicked and then when all the combos are done I add it all back by using table.insert.

Here is my script:
local combos = {combo1Track, combo2Track, combo3Track}

mouse.Button1Down:connect(function()
if equipped == true and canClick == true then --Checking if meele is equipped and canClick == true
for i,v in ipairs(combos) do
print(v.Name)
table.remove(combos,i)
wait(1)

	end
else
	print("Meele not equipped")
end

end)

This isn’t the whole script but I think it is enough to tell the problem.

Are you adding the values back?
It would be more helpful to include all of the code if not most of it as there doesn’t seem to be anything wrong with your current code piece.

Here is the full one I guess
–Created by RinxfulROBLOX, Animations, Combo will run on here, the rest will take place in the serverscript

local meele = script.Parent

local ReplicatedStorage = game.ReplicatedStorage

local meeleEvent = ReplicatedStorage:WaitForChild(“MeeleEvent”)

local equipped = false

local canClick = true

local player = game.Players.LocalPlayer

local character = player.Character

if not character or not character.Parent then

character = player.CharacterAdded:wait() --Checking if character is stil there, do not put this as “local character” it will index as nil

end

local humanoid = character:WaitForChild(“Humanoid”)

local mouse = player:GetMouse()

local combo1 = Instance.new(“Animation”)

combo1.AnimationId = “rbxassetid://6241547671”

combo1.Name = “Combo1”

local combo2 = Instance.new(“Animation”)

combo2.AnimationId = “rbxassetid://6241552356”

combo2.Name = “Combo2”

local combo3 = Instance.new(“Animation”)

combo3.AnimationId = “rbxassetid://6241585092”

combo3.Name = “Combo3”

local combo1Track = humanoid:LoadAnimation(combo1) --Loading before I loop through the animations

local combo2Track = humanoid:LoadAnimation(combo2)

local combo3Track = humanoid:LoadAnimation(combo3)

local combos = {combo1Track, combo2Track, combo3Track} --I put it in a table because when clicked, I am going to loop through these using for i,v in ipairs

local clicks = 0

meele.Equipped:connect(function()

equipped = true

print(“Meele Equipped”) --When Equipped = true, then clicking will be able to happen

end)

meele.Unequipped:connect(function()

equipped = false

print(“Meele unequipped”) --When Equipped = false, then clicking won’t be able to happen

end)

mouse.Button1Down:connect(function()

if equipped == true and canClick == true then --Checking if meele is equipped and canClick == true

for i,v in ipairs(combos) do

print(i.Name)

end

else

print(“Meele Not equipped”)

equipped = false

end

end)

Sorry I deleted some stuff inside the ipairs loop, I am trying to fix it

I tried that but it still didn’t work