Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would you edit a sound script to fit the new changes to the way roblox handles audio now?

Asked by 4 years ago

So I left roblox a while back and basically I just started to get back into the studio part. I don't play much roblox because I mostly stick with studio. Basically I recently found out about changes to using audio in roblox. I rewrote some code for the music I already have in the game. I was wondering how making a sound command would work in roblox with these new changes. Here is my current script if anyone could help me rewrite this code to fit the new changes or at least tell me what I am missing. I read over the wiki but I couldn't find anything about putting in sound ids. I know its a thing because there are still games on roblox that allow you to use your own sound id.

This is an excerpt from my admin commands that I made.

if message:sub(1,6) == "music/" and Admins[plr.Name] then
                local s = Instance.new("Sound", workspace)
                s.Name = "ABACMusic"
                s.SoundId = "rbxassetid://"..message:sub(7)
                s.Looped = true
                s:Play()
                local hint = Instance.new("Hint", workspace)
                hint.Name = "g"
                hint.Text = "Playing: "..message:sub(7)
                hint:Destroy()

        end

Answer this question