So, I have a script for when a Player touched a Part, it changes a Value to Value = Value + 1, therefore, it adds the Value to when it hit's a specific Value count, the game begins a function.
I need a script for whenever the Part glitches (it happens), to count the amount of Parts in the Model that are Green. As in, it needs to check if the Spot is BrickColor.new('Lime green') this is what i've made so far:
court = script.Parent
val = court.Values.Players
while wait() do
for i,v in pairs(court:GetChildren()) do
if v.Name == 'Spot' then
for i = 1, #v do
if v.BrickColor == BrickColor.new('Lime green') then
val.Value = #v
else
return
end
end
end
end
end
Basically, if the Part's ('Spot') inside the ('court') Model are Green then it sets the Value to how many Parts are Green.

1 comment
BrickColor.Value? im checking the BrickColor property of a part, not of a value.