How would you get rid of this error? I wasn’t the one that inserted the sound so I have no idea where the sound that has the asset ID is, so I can’t delete it? I want to keep the output clean so it doesn’t get overflown with these errors.
In the command bar type this:
for i, v in pairs(game:GetDescendants()) do
if v:IsA("Sound") and v.SoundId == "rbxassetid://ID" then
v:Destroy()
end
end
Poor formatting due to being on phone
Yes. When you run a command, it prints the code, and then runs it. I guess the code never found a sound by the ID you specified.
that is weird. I tried running the game and it printed the sound, but I couldn’t find it when I went out of playtest, and then my command bar was empty. I deleted a bunch of models and the sound must have been in one of those. I don’t know what I did wrong with the command bar though.
Where was the sound located when you run the game?
in a model in workspace. I don’t know which model though, because they are just called “model”.
You can modify the code to select the sound when it finds one!
Replace:
print(v)
With:
game.Selection:Set({v})
so the command bar only works when running the game?
The command bar works on the client, server, and edit mode.
then why does it only work in-game for this code?
for i, v in pairs(game:GetDescendants()) do
if v:IsA(“Sound”) and v.SoundId == “rbxassetid://ID” then
print(v)
end end
the issue is that it also unselects it when it goes out of the gametest
The sound is only there during the playtest.
The point of that was to let you find out where it is. So, where is it?
how could it only be there when playtesting though? It’s odd, but since I deleted the model, I don’t think I can find the reason why it would behave that way.
anyway this code does do what it is supposed to, so the command bar seems to be fine.
I’ll put a solved on the original answer, and we assume people looking for this won’t have the same issue as me (or they will just have to find a unique workaround like I did).
I don’t know why that sound only shows during playtesting. Perhaps a script is creating it? You should use Ctrl + Shift + F
to find that soundid in all scripts. If nothing appears, then I don’t know. I tried finding out what that sound is called, but it doesn’t exist.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.