Item # in list problems

I am trying to make a script that checks if a specific country owns a tile, and color it accordingly, in case that there is a glitch or a hacker that changes tile ownership without fighting for it, since there might be a miscolor.
The issue is that it doesn’t check a single part.
I have looked in all the places I could find this issue, but nothing solved it.

Full code:

local children = workspace.Folder.Tiles:GetChildren()
for i = 1, #children do
	if children[i]:GetAttribute("Owner") == "Botswana" then
		script.Parent.Color = Color3.new(0.2, 0.345098, 0.509804)
	end
end

Expectation:
Screenshot 2025-04-27 122905

Result:
Screenshot 2025-04-27 122914

1 Like

I think you mean to put

children[i].Color = Color3.new(0.2, 0.345098, 0.509804)

3 Likes