Line 16 says "attempt to index global 'PEScaptain' (a nil value)
Script:
repeat wait() until game.Players.NumPlayers >= 2
wait(3)
local PESmembers = game.Teams:WaitForChild("PES"):GetPlayers()
local FIFAmembers = game.Teams:WaitForChild("FIFA"):GetPlayers()
local tool = game.ReplicatedStorage.Select
local PEScaptain = PESmembers[math.random(#PESmembers)]
wait(1)
local FIFAcaptain = FIFAmembers[math.random(#FIFAmembers)]
print(PEScaptain.Name.." has been selected as the PES captain!!")
wait(1)
print(PEScaptain.Name.." has been selected as the FIFA captain!!")
game.ReplicatedStorage["Select"]:Clone().Parent = PEScaptian.PlayerGui
game.ReplicatedStorage["Select"]:Clone().Parent = FIFAcaptian.PlayerGui

2 comments
Please put your code in a code block. ;)
There you go.