Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Music Script is not working?

Script is being in an Gui were the sound is too in the dataEE file so thats working, but the music doens't come what wrong? My id list?

(Maybe you need to know its for an mute buttom (Mute works perfect thats why i didnt at the script, so it have to me on sound file and the id have to change every 120 seconds))

Please help

Thanks :)

wait(2) 
sound=script.Parent.dataEE.Sound
repeat wait() until script.Parent.Parent.Parent.Parent:IsA("Player")

sound.SoundId = (163211519 or 144334729 or 145804439 or 185703139 or 142645995 or 147414710 or 187668852)

sound:play()

wait (120)

2 answers

✓ Accepted answer

Here is a simple way to make it work. You did not include an asset finder, such as rbxasset Here is the fix to your problem

local Sound = script.Parent:WaitForChild("dataEE"):WaitForChild("Sound")

SoundIds = {163211519, 144334729, 145804439, 185703139, 142645995, 147414710, 187668852}

Sound.SoundId = "rbxassetid://"..SoundIds[math.random(1, #SoundIds)]

Sound:Play()

wait(120)

-- Use this method

local Sound = script.Parent:WaitForChild("dataEE"):WaitForChild("Sound")

SoundIds = {163211519,144334729, 145804439,185703139,142645995,147414710, 187668852}

Sound.SoundId = SoundIds[math.random(1, #SoundIds)]

Sound:Play()

wait(120)

3 comments

0

Its not working but maybe their has be "http://www.roblox.com/asset/?id=" in right?

1

Yeah, you're forgetting that. You should get an error like 'Content failed because HTTP 400 (HTTP/1.1 400 Input string was not in a correct format.) '

0

You know how to add it ? I never worked with http: and assit links.

This discussion is preserved as it was. New answers, comments, and votes are closed.