How to make a team point capture system?

ive already tried to do this on my own i cant get it to work, heres what ive got so far


-- "pointcap" is a folder in the workspace
local isla = workspace.PointCap.Isla -- team 1
local ra = workspace.PointCap.Raid -- team 2

local iscap = false
local Raicap = false

while Raicap == true do
	print("raider cap")
	ra.Value = ra.Value + 1
end

while iscap == true do
	print("isla cap")
	isla.Value = isla.Value + 1
end

local function onTouch(part)
	local name = part.Parent.Name
	if game.Players[name].TeamColor == ("Maroon")then
		print("Touch started: " .. part.Name)
		print("Isla")
		print("Touch started: " .. part.Name)
		iscap = true
	elseif
		game.Players[name].TeamColor == ("Slime green")then
		print("Touch started: " .. part.Name)
		print("Raider cap")
		print("Touch started: " .. part.Name)
		Raicap = true
	end
end

local function onTouchEnded(part)
	print("Touch ended: " .. part.Name)
end

part.Touched:Connect(onTouch)
part.TouchEnded:Connect(onTouchEnded)
local isla = workspace.PointCap.Isla -- team 1
local ra = workspace.PointCap.Raid -- team 2
local function onTouch(part)
    local player = game.Players:GetPlayerFromCharacter(part.Parent)
    if not player then return end
    if player.TeamColor == "Maroon" then
       print("raid")
       ra.Value+=1
    elseif player.TeamColor == "Slime green" then
        print("isla")
        isla.Value+=1
   end
end
part.Touched:Connect(onTouch)

Yeah you see whenever I run the script and touch the capture point nothing shows up in output and i dont know why to be honest


here is an image of it

since brickcolors are not a string, try doing this

local isla = workspace.PointCap.Isla -- team 1
local ra = workspace.PointCap.Raid -- team 2
local function onTouch(part)
    local player = game.Players:GetPlayerFromCharacter(part.Parent)
    if not player then return end
    if player.TeamColor.Name == "Maroon" then
       print("raid")
       ra.Value+=1
    elseif player.TeamColor.Name == "Slime green" then
        print("isla")
        isla.Value+=1
   end
end
part.Touched:Connect(onTouch)

alright I tried doing this still nothing though.

local ra = workspace.PointCap.Raid -- team 2
local function onTouch(part)
	local player = game.Players:GetPlayerFromCharacter(part.Parent)
	if not player then return end
	if player.TeamColor == game.Teams.Raiders.TeamColor then
		print("raid")
		ra.Value+=1
	elseif player.TeamColor == game.Teams["Islandic Forces"].TeamColor then
		print("isla")
		isla.Value+=1
	end
end
part.Touched:Connect(onTouch)