You’re assigning squads to _G.SquadsList before you actually create the table. The squads variable isn’t going to change automatically. You need to swap those two lines:
_G.SquadsList = {}
local squads = _G.SquadsList
table.insert(squads, player.Name)
Also, as a general rule-of-thumb, using _G is typically considered bad practice. It would be better to throw your SquadsList into a ModuleScript instead.