-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRadio.txt
37 lines (33 loc) · 1.02 KB
/
Radio.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--@name Radio
--@author Sparky
--@shared
--@model models/props_lab/citizenradio.mdl
--Place this chip and type in chat "!song <url to music mp3>" and it'll play that music
if SERVER then
hook.add("PlayerSay","Hey",function(ply,txt)
if ply==owner() and txt:sub(1,6)=="!song " then
net.start("playSong")
net.writeString(txt:sub(7))
net.send()
return ""
end
end)
else
hook.add("net","songs",function(name, len, pl)
if name~="playSong" then return end
if song then song:stop() end
bass.loadURL(net.readString(),"3d noblock",function(snd, err, errtxt)
if snd then
song = snd
snd:setFade(500,10000)
snd:setLooping(true)
--snd:setVolume(1)
hook.add("think","snd",function()
snd:setPos(chip():getPos())
end)
else
print(errtxt)
end
end)
end)
end