local function GetColorPaintedPercent(Color)
local CS = game:GetService("CollectionService")
local TotalPlatesPainted = 0
for _, GamePlate in pairs(CS:GetTagged("GamePlate")) do
if GamePlate.TeamClaimed.Value ~= "" then
TotalPlatesPainted += 1
end
end
local TotalPlatesPaintedTargetColor = 0
for _, GamePlate in pairs(CS:GetTagged("GamePlate")) do
if GamePlate.TeamClaimed.Value ~= "" and GamePlate.TeamClaimed.Value == Color then
TotalPlatesPaintedTargetColor += 1
end
end
print(TotalPlatesPaintedTargetColor)
return math.floor((TotalPlatesPaintedTargetColor / TotalPlatesPainted) * 100)
end
This line prints 0 print(TotalPlatesPaintedTargetColor) messing up the whole calculation
in the loop print what the stringValue returns and also print the color parameter, maybe you are confusing types because when I see “color” I think of a color3