So I have a sandbox game where you can place structures down anywhere and one of them is a metal house with a boombox that you can start playing music with. The thing is, I don’t know how to make a chooser other than to use math.random. The clear problem with this is the fact that it’ll return any in between values of the given ids listed as the variables and that’s not what I want. I want the ids themselves, not the in between integers. The script goes like this:
local m2 = "2256815493"
local m1 = "373247195"
local music = script.Parent.Parent.RadioPlay.soundy1
function onClicked()
print("Click registered")
if music.Playing == true then
music.Playing = false
else
music.TimePosition = 0
music.SoundId = math.random(m2, m1)
music:Play()
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
I must admit, I tried doing something similar to this beforehand and even posted a topic about it but I decided to change some things. If anyone could be of help it would be appreciated.