How do I get rid of this error? "Failed to load ___"

In my game, there’s a feature where players can put any image id of their choice, however with that my console gets spammed with this “Failed to load sound: Asset type does not match requested type”.

Any way of getting rid of it?

3 Likes

Use the pcall() function to remove any error.
Here is how to implement it:

pcall(function()
       -- Your code
end)
2 Likes

It still throws an error for some reason.

1 Like

use:

local succes, errorMessage = pcall(function()
--Code
--Example:
Asset.AssetId = input
end)

if errorMessage then
--Here you can display  that the id didnt work and notification or smth
end
1 Like

Like I said, it still throws an error even though I am using protected calls.

1 Like

Can you share the whole code with us then please?

1 Like

same thing happens when you use soundids, think its just a roblox thing