"Table expected, got Instance"

the second you hear the title you’re gonna say “this has been asked many times” and yes ive tried to find other topics similar to my problem but they didn’t seem to help

and i dont have enough braincells to figure out why im getting that issue when trying to use table.move, so ill just leave whats necessary from my script:

local Players = game:GetService("Players")

local inGamePlayers = {}
local eliminatedPlayers = {}

Players.PlayerAdded:Connect(function(player)
	table.insert(eliminatedPlayers, player) -- adds the player to this table
end)

local function Round()
	for i, player in pairs(eliminatedPlayers) do 
		table.move(eliminatedPlayers[i], inGamePlayers) -- this is where im getting argument #1 invalid, table expected got instance error
	end
end

Its easier to just do this

local Players = game:GetService("Players")

local inGamePlayers = {}
local eliminatedPlayers = {}

Players.PlayerAdded:Connect(function(player)
	table.insert(eliminatedPlayers, player) -- adds the player to this table
end)

local function Round()
	inGamePlayers = eliminatedPlayers
end

1 Like

Not sure how I didn’t figure that out but okay. For future reference, what did I do wrong anyway?

That’s because this returns a type of instance which is the player, just remove the [i]. About table.move

1 Like

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