hi so i made a script that have to replace the song if the song ended but that cant change/replace the music when the music ended sombody can tell me why? and how can i actually fix that…
here is the script:
local Songs = {
Song1 = "rbxassetid://609760145";
Song2 = "rbxassetid://4508163804";
Song3 = "rbxassetid://301217890";
Song4 = "rbxassetid://1102170531";
Song5 = "rbxassetid://1102130218";
Song6 = "rbxassetid://3417133618";
Song7 = "rbxassetid://290176752";
Song8 = "rbxassetid://1851637813";
Song9 = "rbxassetid://1841988384";
Song10 = "rbxassetid://330094723";
Song11 = "rbxassetid://292146823";
Song12 = "rbxassetid://1347235854";
Song13 = "rbxassetid://363196126";
Song14 = "rbxassetid://294096668";
Song15 = "rbxassetid://446510533";
Song16 = "rbxassetid://2676688936";
Song17 = "rbxassetid://182448496";
Song18 = "rbxassetid://1323196760";
Song19 = "rbxassetid://657360299";
}
while wait() do
if script.Parent.TimeLength == 0 or script.Parent.TimeLength <= 1 then
script.Parent.SoundId = Songs["Song"..math.random(1, 19)]
end
end
I told you to use an array instead of that dictionary. Also, its not there for you to just copy and paste because of course you still need to create the audio source audio and use the right variables appropriate to your code (i.e. Songs)
just for the record that script is exactly what i had written except audio was assigned to so it was something you had written and i guess the dictionary thing because still not using an array…?