Trying to give all players in a team points once two capture points are held

I’m trying to check if a team holds these two points. If a team has these two points then all players in the team will begin to acquire points over time. I believe my issue is with the first if statement, but there are no errors in the output log and from my poking around I’m not sure what I’ve done wrong here.


local workSpace = game:GetService("Workspace")
local teams = game:GetService("Teams")

while true do
	if workSpace.Point1.pole1.BrickColor == "Navy blue" and workSpace.Point2.pole2.BrickColor == "Navy blue" then
		local playersCrips = teams.Crips:GetPlayers()
		for i, v in pairs(playersCrips)do
			if v:FindFirstChild("leaderstats") and v then
				v.leaderstats.Points.Value = v.leaderstats.Points.Value + 10
			end
		end		
	end
	wait(1)
end

The pole1 and pole2 will have their brick color changed via another script. I doubt the issue involves the leaderstats but if you need to see that script as well, just let me know.

1 Like

I think this information may be useful as well so I’ll post it here.

image

image

image

Here’s two more pictures. The first picture is of the leaderstats script and the second is of the teams. Maybe this will help people answer this problem.

It’s because you’re comparing the color to a string value, and not to an actual BrickColor value.
BrickColor.new("color")

2 Likes

Yeah, I just added on BrickColor.name to both of those values and it works now, thanks.