Skip to content

Instantly share code, notes, and snippets.

@moonexpr
Created May 28, 2017 18:02
Show Gist options
  • Save moonexpr/bc6cd45995c820a38fdc489f06d860cd to your computer and use it in GitHub Desktop.
Save moonexpr/bc6cd45995c820a38fdc489f06d860cd to your computer and use it in GitHub Desktop.
Assists with sound assets over HTTP[s]
util.AddNetworkString ("ISoundManager/Play")
soundmanager = {}
function soundmanager:Broadcast (strURL)
net.Start ("ISoundManager/Play")
net.WriteString (strURL)
net.Broadcast ()
end
function soundmanager:Send (strURL, mxClients)
net.Start ("ISoundManager/Play")
net.WriteString (strURL)
if type (mxClients) == "table" then
for i = 1, #mxClients do
net.Send (mxClients [i])
end
elseif type (mxClients) == "Player" then
net.Send (mxClients)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment