Roblox Argument 1 missing or nil

hi i made index system but when i test the index there is error.
here is the error:
image
and the script:

while wait() do
    		for _,v in pairs(script.Parent.Index.PetsEggs:FindFirstAncestorWhichIsA("Frame"):GetChildren()) do
    			if player:WaitForChild("Discovered"):FindFirstChild(v.Name) and v:IsA("ViewportFrame") then
    				v:FindFirstChild(player:WaitForChild("Discovered"):FindFirstChild(v.Name)).ImageColor3 = Color3.fromRGB(255, 255, 255)
    			else
    				v:FindFirstChild(player:WaitForChild("Discovered"):FindFirstChild(v.Name)).ImageColor3 = Color3.fromRGB(0, 0, 0)
    			end
    		end
end

Can you show use the line which it is erroring?

FindFirstChild requires the name of the bricks, not the instance of it. This is why it’s erroring.
v:FindFirstChild(Instance) is invalid.

line 544 (i sent only the lines of the index)

thanks for the help but is still with the same problem… :confused:

Can you show me how you’ve modified the lines?

while wait() do
		for _,v in pairs(script.Parent.Index.PetsEggs:FindFirstAncestorWhichIsA("Frame"):GetChildren()) do
			if player:WaitForChild("Discovered"):FindFirstChild(v.Name) and v:IsA("ViewportFrame") then
				v:FindFirstChild(player:WaitForChild("Discovered"):FindFirstChild(v)).ImageColor3 = Color3.fromRGB(255, 255, 255)
			else
				v:FindFirstChild(player:WaitForChild("Discovered"):FindFirstChild(v)).ImageColor3 = Color3.fromRGB(0, 0, 0)
			end
		end
end

Did you attempt to just do v.ImageColor3? It looks like you’re attempting to target the same item using the FindFirstChild.

Also, that was terribly wrong.

i did that but instead change the pets color is change the frame color

Mabey after the last FindFirstChild(v).name

1 Like
v:FindFirstChild(player:WaitForChild("Discovered"):FindFirstChild(v.Name).Name).ImageColor3

Does this help?