Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why I cant preload Image? Unable to cast to Array

local ContentProvider = game:GetService("ContentProvider")

local BaseUrl = "rbxassetid://"

Icons = {
empty = 131719387,
key_icon = 1367122183,
}

ContentProvider:PreloadAsync(BaseUrl .. Icons.key_icon) -- Unable to cast to Array

1 answer

The answer is simple. Unable to cast to SOMETHING means that u called a Function and gave it Something but Roblox expected a Table but u gave it a string.

PreloadAsync requires u to give a Table with Objects. not a string, or a Table with Content URLs

This discussion is preserved as it was. New answers, comments, and votes are closed.