I have a team select gui that when you click on the team, it assigns a team color. I am using a team save method from an answer on this forum that goes:

[Edit by JesseSong:] Please provide error code (if applicable), failed solution, prints etc.

Also, please use the codeblock

####Any further announcement please read: Click on this hyperlink


local teamModule = {}

local DataStore2 = require(1936396537)

DataStore2.Combine("MainKey","Team") -- You Can Change MainKey To Any New Value To Reset The DataBase

local defaultTeam = "White"

function teamModule:SetPlayerTeam(player)
	if player:IsA("Player") then
		local excessData = Instance.new("Folder",player)
		excessData.Name = "ExcessData"
		
		local teamValue = Instance.new("StringValue",excessData)
		teamValue.Name = "Team"
		
		local teamStore = DataStore2("Team",player)
		
		local function updateTeam(team)
			player.ExcessData.Team.Value = team
		end
		
		updateTeam(teamStore:Get(defaultTeam))
		
		teamStore:OnUpdate(updateTeam)
	else
		error("The First Parameter Has To Be A Player")
	end
end

return teamModule
(module script btw)
and then a script 
local teamModule = require(script.Parent.TeamModule)

local DataStore2 = require(1936396537)

local RE = game:GetService("ReplicatedStorage"):WaitForChild("Events")

game.Players.PlayerAdded:Connect(function(player)
	teamModule:SetPlayerTeam(player)
	wait(1)
	local team = game:GetService("Teams"):FindFirstChild(player.ExcessData.Team.Value).TeamColor
	wait()
	player.TeamColor = team
	wait(0.25)

	

end)

RE:WaitForChild("SelectTeam").OnServerEvent:Connect(function(player,team)
	player.TeamColor = game:GetService("Teams"):FindFirstChild(team).TeamColor
	player.ExcessData.Team.Value = team
	local teamStore = DataStore2("Team",player)
	teamStore:Set(team)
	wait(0.1)
	player:LoadCharacter()
end)

However, it keeps saying attempt to index TeamColor with nil for game:GetService("Teams"):FindFirstChild(player.ExcessData.Team.Value).TeamColor. That is the error in my code. How should I fix this?