Here's the script:
local pes = game.Teams.PES:GetPlayers
local fifa = Teams.FIFA:GetPlayers
local myArray = {fifa, pes}
#myArray
math.random(x)
myArray[x]
myArray[math.random(#myArray)]
end)
I'm basically trying to get team captains for a soccer game. The 2nd 'local' has an error for some reason and I can't seem to figure out why.

2 comments
Does this allow me to give the same random captain a gui/hopperbin?
Yes, the PEScaptian and FIFAcaptian are player instances, so you can just clone the GUI into PEScaptian.PlayerGui (or FIFAcaptian) and hopperbins into PEScaptian.Backpack