So, I'm trying to make a random song picker for intermission and it stays the same everytime. I even used
math.randomseed(tick())
And it still picks only one song so, whats wrong? Script in ServerScriptService
while true do math.randomseed(tick()) INTERMISSION_TIME = 45 --How long intermission is PLAY_TIME = 15 --How long people play for local songs = game.ServerStorage.Songs local songList = songs:GetChildren() local randomSong = math.random(1, #songList) songs[randomSong]:Play() print(songs[randomSong].Name) wait(INTERMISSION_TIME) songs[randomSong]:Stop() wait(PLAY_TIME) end
The songs are in serverstorage in a folder, each named 1,2,3 you get the idea. Each time it prints 3 and plays the third song.
while true do math.randomseed(tick()) INTERMISSION_TIME = 45 --How long intermission is PLAY_TIME = 15 --How long people play for local songs = game.ServerStorage.Songs local songList = songs:GetChildren() local randomSong = math.random(1, #songList) songs[tostring(randomSong)]:Play() print(songs[randomSong].Name) wait(INTERMISSION_TIME) songs[randomSong]:Stop() wait(PLAY_TIME) end