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

Music Script is not working?

Asked by 8 years ago

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

Log in to vote
1
Answered by 8 years ago

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)
Ad
Log in to vote
0
Answered by 8 years ago

-- 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)
0
Its not working but maybe their has be "http://www.roblox.com/asset/?id=" in right? minetrackmania 186 — 8y
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.) ' NotSoNorm 777 — 8y
0
You know how to add it ? I never worked with http: and assit links. minetrackmania 186 — 8y

Answer this question