Hello everyone! I’m trying to preload the images of my game gui, but for some reason this error is happening: Images is not a valid member of ModuleScript. I’ve never used ModuleScripts before, so I got no idea what to do. Here’s my code:
--Local script at ReplicatedFirst
local ContentProvider = game:GetService("ContentProvider")
local ImagesModule = script.Images
local function checkFailed(contentId, Status)
if Status == Enum.AssetFetchStatus.Failure then
print("Failed:", contentId)
end
end
ContentProvider:PreloadAsync(ImagesModule.images, checkFailed)
Is the ModuleScript required by the client (a local script)? If it is you may need to use WaitForChild to wait for the ‘Images’ folder to load/replicate.
I thought the same, but I tried fixing it by changing the variable local ImagesModule = script.Images to local ImagesModule = script:WaitForChild("Images") but nothing happened. But as I said, I’ve never used ModuleScripts before so I got no idea of what I’m doing