So i have this bug on my random playlist script. The bug is even though i set this to loop through every singlething on the table randombly 1 by one its still sometime play the same song after one song is finished i wonder what’s wrong
local ids = {6045803313,6045799419,5977968880,288756677,2547086627,743287013,665711112,3044286747,269096289,603146550,639750143,170902050,188225491,144183348,230210363,4758766451,468891571,918941572,714630890,265512831,259816079,311316650,} -- your song ids here
repeat wait()
for i = 1, #ids, 1 do -- loops through the table
local songObj = Instance.new("Sound")
local random = Random.new()
songObj.Parent = game:GetService("SoundService")
local nowPlaying = ids[random:NextInteger(i,#ids)]
print("playing song No. " .. i)
songObj.SoundId = "rbxassetid://"..nowPlaying
songObj.Volume = 1
songObj:Play()
songObj.Ended:Wait()
songObj:Destroy()
end
until false