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

How do I change the SoundId using a script?

Hi, I am trying to make a music script. Instead of putting a lot of sounds in, I wanted to make it so only 1 sound, but the script changes the ID. It is not working for me. Can you help?

while true do
	script.Parent.Sound.SoundId = 438917260
	script.Parent.Sound.Playing = true
	wait(50)
end

Instead, it does NOT change the SoundId. It actually makes the scripts hang.

Thanks!

1 comment

0

To explain FiredDusks answer a bit more, all asset ids must be a url. The generic (and easy to remember) url for ROBLOX assets is 'rbxassetid://assetId'.

1 answer

✓ Accepted answer

The SoundId is actually a string (text), not a numbervalue. But you also have to add in something like 'rbxasset:// '.

while true do
    script.Parent.Sound.SoundId = 'rbxasset://438917260'
    script.Parent.Sound.Playing = true
    wait(50)
end

6 comments

0

Did not work.

0

It's rbxassetid://

0

Ok.

0

If this question is solved please accept FireDusk's answer or write Answered on the title

0

Except, it's rbxassetid:// not rbxasset://

0

Ahh thanks guy! I was at school so I had to try my best :P

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