So I am making a minigame inside of a game. When the player clicks a button, I want them to be put into a folder/list/table etc. that will keep track of who is in the queue for minigames. Here is what I have:
local p = game.Players.LocalPlayer
local minigamePlayers = {}
script.Parent.MouseButton1Click:Connect(function()
table.insert(minigamePlayers,p)
end)
print(minigamePlayers)
script.Parent.MouseButton2Click:Connect(function()
table.remove(minigamePlayers,p)
end)
print(minigamePlayers)
The problem is the table never gets printed and I get an error when I right click: 18:02:59.315 - Players.tiller0831.PlayerGui.MB.TextButton.LocalScript:11: invalid argument #2 to 'remove' (number expected, got Instance)
