Roblox has a extensive sound library and I’m trying to get some SFX from it. The function keeps returning nil, and I have no idea why. Here is how I load assets:
local INSERT = game:GetService("InsertService")
local function loadAsset(assetId)
if assetId == nil then return nil end
for i = 1, 3 do
local success, asset = pcall(INSERT.LoadAsset, INSERT, assetId)
if success and asset then
print(asset)
print(asset:GetChildren())
asset = asset:GetChildren()[1] -- it's automatically is wrapped in a model
return asset
end
end
print("Asset failed to load after retries!")
end
local asset = loadAsset(9117969892)
print(asset)
The asset in question: https://create.roblox.com/marketplace/asset/9117969892/Punch-Kit-Beefy-Hit-5-SFX
I know that the function works because I can load personal models with it AND it wouldn’t return nil if there was an error to retrieve the asset. InsertService is just returning a empty model.
I’m not sure if this is due to an issue with Roblox’s weird sound privacy changes. This doesn’t work in my group game (the place where I actually want to use it) or my personal testing place.