How do i preload Images?
i’ve tried to preload them with PreloadAsync but it didn’t work
here is the code that i used
local Images = {}
local imagesleft = #Images
local ContentProvider = game:GetService("ContentProvider")
for _,v in pairs(script.Parent:GetDescendants()) do
if v:IsA("ImageLabel") or v:IsA("ImageButton") then
table.insert(Images,1,v.Image)
end
end
ContentProvider:PreloadAsync(Images, function()
imagesleft = imagesleft - 1 -- keeping count if you want to add some accuracy to a loading bar or something
print(imagesleft)
end)
any help would be appreciated