Using FindFirstChild with a table

Hello,
I am trying to make a random ore spawning system and I’m running into some issues. I’m storing the possible ores that can spawn within a table by its name. The issue that I’m running into is that when I try to clone the ore from ReplicatedStorage using the name from the table, it keeps returning nil. The ore is part of the table, so that’s not the issue.

               local possibleOres = {}
				local rn = math.random(1, 500)
				if (possibleOres[rn] == nil) then
					local ore = game.ReplicatedStorage.Ores.stone:Clone()
					ore.Position = newPos
					ore.Parent = workspace.Blocks
					ore.Name = ore.Name .. counter
					counter += 1
				else
					if (game.ReplicatedStorage:FindFirstChild("Ores"):FindFirstChild(possibleOres[rn])) then
						local block = game.ReplicatedStorage.Ores:FindFirstChild(possibleOres[rn]):Clone() -- This is the issue line!
						block.Position = newPos
						block.Parent = workspace.Blocks
						block.Name = block.Name .. counter

						counter += 1
					else
						print("[NOTICE: Unable to generate ore!")
						Generate(pos)
					end
				end

Is there a possible better way to do this / a right way?
Thanks!

Do you need to access it from a custom table? You could probably just do

local function pickOre()
    local ores = game.ReplicatedStorage.Ores:GetChildren()
    return ores[math.random[1, #ores]
end

I was using a table because I through of a really janky way to do rarity. The less rare, the more it added to the table. But, after seeing the code you posted, I think I can use it to make a better system.