I’m trying to preload module sounds when the game first starts. code for the sound module:
and so on.
I got preloading weapons (they have sounds inside of them too) to work just fine, but the game just doesn’t want to load any asset IDs from here.
-- STUFF LOADING
local replicatedStorage = game:GetService("ReplicatedStorage")
local contentProvider = game:GetService("ContentProvider")
-- bla bla
local function notePreloadAsset(id)
if type(id) ~= "string" then return end
print("-------------")
print("Loading "..id)
-- output always provides a valid asset ID, never a table memory address
contentProvider:PreloadAsync({ tostring(id) })
end
-- bla bla
print("Loading sounds")
function scan(item)
if type(item) == "table" then
-- notePreloadAsset(item)
for i,v in pairs(item) do
scan(v)
end
elseif type(item) == "string" then
notePreloadAsset(item)
end
end
for _,tbl in pairs(resourceModule) do
for i,v in pairs(tbl) do
scan(v)
end
end
It loads the first part notePreload
just fine, but the moment sounds start preloading, every single one of them fails
rbxassetid://4546464750
Loaded
rbxassetid://4546542797
Loaded
rbxassetid://3446917718
Loaded
rbxassetid://4546461227
Loaded
rbxassetid://4565061617
Loading sounds
-------------
Loading rbxassetid://3689682801
11:43:09.111 - ContentProvider:PreloadAsync() failed for rbxassetid://3689682801
-------------
Loading rbxassetid://3689683132
11:43:09.145 - ContentProvider:PreloadAsync() failed for rbxassetid://3689683132
-------------
Loading rbxassetid://4776517267
11:43:09.178 - ContentProvider:PreloadAsync() failed for rbxassetid://4776517267
-------------
Loading rbxassetid://4776516378
11:43:09.212 - ContentProvider:PreloadAsync() failed for rbxassetid://4776516378
-------------
Loading rbxassetid://4776516615
11:43:09.247 - ContentProvider:PreloadAsync() failed for rbxassetid://4776516615
-------------
Loading rbxassetid://4776516160
11:43:09.279 - ContentProvider:PreloadAsync() failed for rbxassetid://4776516160
-------------
Loading rbxassetid://4776516905
11:43:09.312 - ContentProvider:PreloadAsync() failed for rbxassetid://4776516905
-------------
How do I get the asset IDs to load in?