Having trouble with table.remove()

So I am trying to create a number system for when you get to perform, and decided to use a table to do so but it is not removing the values I tell it to when I say table.remove(). Here is my script:
Adding Values:

game.Workspace.GlobalValues.AmountOfDancers.Value = game.Workspace.GlobalValues.AmountOfDancers.Value + 1
		plr.DancerQue.Value = game.Workspace.GlobalValues.AmountOfDancers.Value
		table.insert(DanceTable, plr.DancerQue.Value)
		print(DanceTable[1])

Removing values:

plr.DancerQue.Value = nil
			table.remove(DanceTable, plr.DancerQue.Value)
			print(DanceTable[1])

I have tried multiple different ways but none of them seem to be working.
Thanks! :smile:

table.remove takes an index as the second parameter.

The 2nd parameter of table.remove() should be a number. If plr.DancerQue is a IntValue then it probably doesn’t remove because the value of plr.DancerQue is not 1

2 Likes

Would I be able to remove it if it was 0?

Nope it wouldn’t because a table wouldn’t have a index that is 0.

2 Likes