Code to get all texture IDs

Hello, I am trying to get a code to obtain all unique texture IDs within our game. A code that obtains all texture IDs, that being IDs of the same won’t work.

I have tried this code:

function alreadyExists(texture)
local exists = false
for _,v in pairs(workspace.Texture:GetChildren()) do
    if v.TextureId == texture.TextureId then
        exists = true
    end
end
return exists
end
for _,v in pairs(workspace:GetDescendants()) do
if v:IsA("Texture") then
    if alreadyExists(v) == false then
        v:Clone().Parent = workspace.Texture -- clone to texture folder
    end
end
end

However this only returns one texture ID in the texture folder. I don’t know why exactly (this was a solution to a similar post.)

If anyone can help, this’ll be much appreciated