RoKjellJoin Date: 2012-11-22 Post Count: 1205 |
I'm trying to make sounds keep playing in a random order andEvery person in the server has to hear the same song, but it doesn't work.
This is the script:
function musicwhileplaying()
--[[for _, asset in ipairs(id) do
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=" .. asset)
end]]
while game.Workspace.MusicSystem.IsPlaying == true do
print("Before wait:")
print(game.Workspace.MusicSystem.IsPlaying)
print("waiting "..game.Workspace.MusicSystem.TimeLength.." seconds")
wait(game.Workspace.MusicSystem.TimeLength)
print("After wait:")
print(game.Workspace.MusicSystem.IsPlaying)
game.Workspace.MusicSystem:Stop()
end
musicplaying()
end
function musicplaying()
game.Workspace.MusicSystem.SoundId = "rbxassetid://".. id[math.random(1,31)]
game.Workspace.MusicSystem:Play()
wait(5)
musicwhileplaying()
end
musicplaying()
asset is a Array with some sound ID's
Tunez, Best. Night. Ever. http://www.roblox.com/My/Groups.aspx?gid=2661181 |