I have the following code in a module that is supposed to load assets and print them if chosen. However, they do not print.
local module = {}
function Callback(ContentID, Status, PrintStuff)
if PrintStuff == true then
if Status == Enum.AssetFetchStatus.Success then
print("Content ("..ContentID..") successfully loaded.")
elseif Status == Enum.AssetFetchStatus.Failure then
print("Content ("..ContentID..") failed to load.")
end
end
end
function module:PreloadAssets(ContentTable, ShouldPrint)
if ShouldPrint == nil then ShouldPrint = false end
print(ShouldPrint)
if ShouldPrint then
game:GetService("ContentProvider"):PreloadAsync(ContentTable, Callback)
else
game:GetService("ContentProvider"):PreloadAsync(ContentTable)
end
end
return module
What print
s is basically ShouldPrint
, true
if chosen, or false
if nil. But the first 2 print
s do not get outputted. What should I do?