Help With Player's Team Name

I can’t get pasted this issue. Sometime it works like I want and other times it works like this. I used this print(teamName, scoringPlayer.Value, goalType, pointsss)

BlueTeam Cyber_Designer BlueGoalValue 0

This is what supposed to happen and vise versa for the Orange team

Problem: The player own goals because team name does not equal goal’s value. Witch is what I want, but sometimes the player is on the blue team not orange and it is printing the player is on orange team.

OrangeTeam Cyber_Designer BlueGoalValue 0
--==============================================================================
--LOCAL SCRIPT >> STARTERGUI
--==============================================================================
--<<SERVICES>>
local Teams = game:GetService("Teams")
local Players = game:GetService("Players")
--==============================================================================
--<<VERIABLES>>
local Stats = workspace.Statss
local scoringPlayer = Stats.BallPossession
local blueGoalValue = Stats.BlueGoalValue
local orangeGoalValue = Stats.OrangeGoalValue
local player = Players.LocalPlayer
local scoreFrame = player.PlayerGui:WaitForChild("ScreenGui").ScoreFrame
local announcementLabel = scoreFrame.AnouncmentLabel
local rewardTextLabel = scoreFrame.RewardTextLabel
--==============================================================================
--<<FUNCTIONS>>
local function getTeamName(player)
	for _, team in pairs(Teams:GetTeams()) do
		if team:IsA("Team") then
			return team.Name
		end
	end
	return nil
end

local function displayGoalResult(color, text)
	announcementLabel.TextColor3 = color
	announcementLabel.Text = text
	wait(2)
	announcementLabel.Text = ""
	announcementLabel.TextColor3 = Color3.new(0.988235, 0.784314, 0.0470588)
end

local function handleGoal(goalType)
	local teamName = getTeamName(scoringPlayer.Value)
	local pointsss = "non"
	if teamName then
		if (teamName == "BlueTeam" and goalType == orangeGoalValue) or
			(teamName == "OrangeTeam" and goalType == blueGoalValue) then
			displayGoalResult(Color3.new(1, 0, 0), "OWN GOAL!")
			pointsss = "0"
		else
			if (teamName == "BlueTeam" and goalType == blueGoalValue) then
			displayGoalResult(Color3.new(0.0470588, 0.345098, 0.988235), string.upper(scoringPlayer.Value .. " SCORED"))
				pointsss = "+1"
			end
			if (teamName == "OrangeTeam" and goalType == orangeGoalValue) then
				displayGoalResult(Color3.new(0.988235, 0.407843, 0.0470588), string.upper(scoringPlayer.Value .. " SCORED"))
				pointsss = "+1"
			end
		end
		print(teamName, scoringPlayer.Value, goalType, pointsss)
	end
end
--==============================================================================
--<<CONNECTIONS>>
blueGoalValue.Changed:Connect(function()
	handleGoal(blueGoalValue)
end)

orangeGoalValue.Changed:Connect(function()
	handleGoal(orangeGoalValue)
end)
--==============================================================================