I have a script that needs to run through all of the players. It's telling me this error though
ServerScriptService.LevelHandler:2: bad argument #1 to 'pairs' (table expected, got Object)
local players = game:GetService("Players")
for _, player in pairs(players) do
print("works")
end
Why does it think that players is an object?

1 comment
pairs takes in a table, so it would be player:GetPlayers()