How to preload images?

I’m trying to load my images and sound id’s while in a loading screen, but I can’t seem to get it right.

    -- local script inside replicated first
    local function checkFailed(contentId, st)
        print(st)
    end
    ContentProvider:PreloadAsync(guiImagesModule.images, checkFailed())
   -- module script inside the local script
   local images = {}
   images.images = {
           paperCurtain = "http://www.roblox.com/asset/?id=6159680612",
           loadingBar = "http://www.roblox.com/asset/?id=6180336941"
    }
        return images

it returns an error saying unable to cast to array. What am i doing wrong? I think I followed all the steps here:

PreloadAsync accepts an array of things to preload, you can’t pass a dictionary!

-- LocalScript
local function checkFailed(contentId, Status)
   if Status == Enum.AssetFetchStatus.Failure then
       print("Failed to load", contentId)
   end
end

ContentProvider:PreloadAsync(guiImagesModule.images, checkFailed)

-- Module
local images = {}
images.images = {
     "http://www.roblox.com/asset/?id=6159680612",
     "http://www.roblox.com/asset/?id=6180336941"
}
return images
8 Likes

ohhhhhhhhhhhhhhhhhhhhhhhhhhhh, thank u bro, I got dictionaries and arrays mixed up, the more you know

i just put 52 image ids into the module and preloaded it and they all came false :sob: