Skip to content

Instantly share code, notes, and snippets.

Created Sep 12, 2016
Embed
What would you like to do?
EndRoundMusic = EndRoundMusic or {}
if CLIENT then
net.Receive("EndRoundSong", function()
local song = net.ReadString() or ""
local winners = net.ReadString() or ""
LocalPlayer():ChatPrint( "Song: "..song )
sound.PlayFile( song, "mono", function( station )
if IsValid( station ) then
EndRoundMusic.Station = station
EndRoundMusic.Station:Play()
end)
end)
net.Receive("EndRoundSongStop" function()
local msg = net.ReadString()
if EndRoundMusic.Station then
EndRoundMusic.Station:Stop()
LocalPlayer():ChatPrint( "Stopping current song" )
end
end)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment