You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? hi, i want to know that what is the most value that valueobject have
-
What is the issue? but my current script having abit issue
-
What solutions have you tried so far? keep research but still dont found anything help
you can see that block has color different
Every Black Color Have “1” NumberValue
Every Red Block Have “3” NumberValue
and i want to know if Black Color Have More Than Red Color
local function FindMostTag()
for i, v in pairs(ReplaceTag) do
local TagCount = 0
local TagNumber = 0
for i, TagBlock in pairs(MapFolder:GetChildren()) do
local TagBlockValue = TagBlock:WaitForChild("Tag")
if TagBlockValue and TagBlockValue.Value ~= 0 then
if TagNumber == 0 then
TagCount += 1
TagNumber = TagBlockValue.Value
end
if TagNumber ~= 0 and TagNumber == TagBlockValue.Value then
TagCount += 1
elseif TagNumber ~= 0 and TagNumber ~= TagBlockValue.Value then
end
end
end
MostTag[TagNumber] = TagCount
end
end
this is my script but this script will only count the first value it found, so if It Have 3 Red Block, 10 Black Block but it found the red block first black block will never count on the function
