Apparently to add and remove players off the xf list of mine, i need to call the numbers but I don't know that, but by doing removing the table if the name of the value is caught. the error log says number expected not tostring. What can I do? Thanks
local xf = {
"...",
}
for i, v in pairs(game:GetService("Players"):GetPlayers()) do
if v ~= game:GetService("Players").LocalPlayer then
table.insert(xf, tostring(v.DisplayName))
end
end
game.Players.PlayerAdded:Connect(function(v)
if not table.find(xf, tostring(v.DisplayName)) then
table.insert(xf, tostring(v.DisplayName))
end
end)
game.Players.PlayerRemoving:Connect(function(v)
if table.find(xf, tostring(v.DisplayName)) then
table.remove(xf, tostring(v.DisplayName))
end
end)[](http://)

3 comments
table.insert(a, b, c) "b" is expected to be a number or nil
https://developer.roblox.com/en-us/api-reference/lua-docs/table
but it seems like the way you've done it is also valid, hmm