Dax009ink
(Dax009)
#1
I’d like to figure out how to check if a sound is moderated in a script.
Usually, it just stops my entire script (because it’s waiting for the moderated song to be over), and that’s a problem.
I can’t find anything on the DevForum/Hub about this, and I just need some help.
I can send my whole script if needed.
You can use ContentProvider in a pcall()
and check if it’s loaded.
B2ontwitch
(B2ongalaxy)
#3
spawn(function()
-- The code you put in here will run and it won't stop the entire script
end)
Zenokei
(Zenokei)
#4
Would you mind showing me a section of code and explaining what you require in more detail?
Dax009ink
(Dax009)
#5
Here’s a snippet of my code
function playNewSound()
print("Getting sound...")
local sound = getRandomSound()
local name = game:GetService("MarketplaceService"):GetProductInfo(sound).Name
game.ReplicatedStorage.CurrentSong.Value = name
script.Parent.SoundId = baseUrl .. tostring(sound)
print("Sound found! " .. name)
DaxBot:SayMessage("🎶 Now playing: " .. name, "All")
script.Parent.TimePosition = 0
script.Parent:Play()
print("Playing..")
end
I want to check if a sound is moderated so it can be skipped and have another song chosen. I don’t really know how to explain it better.