So, yesterday I tried to make a radio that plays music in a playlist that loops. (Inspired by the music cube from eqiunos ok place - Roblox)
I only have two songs in the rotation, as I just wanted to test it out before adding every song.
But it definitely didn’t work out as expected.
Instead of making a loop of songs from start to finish, it played a bit of the first song, then played the second half of the second song, then completely stopped. There were no errors in the output so I’m asking for help here.
Please tell me what I’m doing wrong and how I can actually make it work.
--variables
local Source = game.Workspace.Source
function music(SoundId)
Source.Sound.SoundId = "rbxassetid://"..SoundId
Source.Sound:Play()
Source.Sound.Ended:Wait(0.1)
end
while true do
wait(0.2)
music("466445479")
music("5434920494")
end
Help would be greatly appreciated. Thanks!
(Sorry if the script is messy)