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

How do I change the SoundId using a script?

Asked by 8 years ago

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!

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'. TheDeadlyPanther 2460 — 8y

1 answer

Log in to vote
1
Answered by
FiredDusk 1466 Moderation Voter
8 years ago

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

0
Did not work. vinniehat54 18 — 8y
0
It's rbxassetid:// Decemus 141 — 8y
0
Ok. vinniehat54 18 — 8y
0
If this question is solved please accept FireDusk's answer or write Answered on the title LisaF854 93 — 8y
View all comments (2 more)
0
Except, it's rbxassetid:// not rbxasset:// lightpower26 399 — 8y
0
Ahh thanks guy! I was at school so I had to try my best :P FiredDusk 1466 — 8y
Ad

Answer this question