Hello i am trying to preload pictures in my game. I have four image ID's in string values. However only two of the pictures are working and the others are just white and giving an error saying they couldn't be loaded. So heres my script and it gives me this error:
My error: Unable to cast to Array Script 'Players.bondhemlig.PlayerGui.PictureLoading', Line 12 - local LoadAssets Script 'Players.bondhemlig.PlayerGui.PictureLoading', Line 24
I don't know what this error means so help would be appreciated.
Local Script:
repeat wait(0.5) print("DO") local ContentProvider = game:GetService("ContentProvider") local function LoadAssets(AssetList) wait() for _, AssetId in ipairs(AssetList) do print(AssetId) ContentProvider:PreloadAsync("http://www.roblox.com/asset/?id=" .. AssetId) end end local Pics={} for i,v in pairs(game.Workspace.Values.MPics:GetChildren())do if v:IsA("StringValue")then table.insert(Pics,v.Value) end end LoadAssets(Pics) until ContentProvider.RequestQueueSize <= 0 script:Remove()
Help would be appreciated thanks!