Advertisement
kirkarr

Untitled

Jul 29th, 2023
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. @name Radio
  2. @inputs
  3. @outputs
  4. @persist OK Last URL:string
  5. @trigger
  6. @model models/props_lab/reciever01b.mdl
  7. runOnTick(1)
  8. E = entity()
  9. if(first()){
  10. holoCreate(0,E:toWorld(vec(6.4,0,-0.5)),vec(0.1,1.25,0.5))
  11. holoParent(0,E)
  12. for(I=1,14){
  13. holoCreate(I,E:toWorld(vec(6.45,-7.5+I,E:boxMin():z()+0.25)),vec(0.1,0.1,I/12))
  14. holoColor(I,vec(0,0,0))
  15. holoClipEnabled(I,1)
  16. holoClip(I,vec(0),vec(0,0,1),0)
  17. holoDisableShading(I,1)
  18. holoParent(I,0)
  19. }
  20. holoCreate(15,E:toWorld(vec(-5.5,-6.5,0)),vec(0.05))
  21. holoModel(15,"models/props_c17/utilitypole03a.mdl")
  22. holoParent(15,E)
  23. URL = "https://rur.hitmotop.com/get/music/20221107/ThxSoMch_-_Spit_in_my_face_74984226.mp3"
  24. soundURLplay("songus")
  25. soundURLload("songus",URL,100,0,E)
  26. }
  27. FFT = E:soundFFT("songus")
  28. soundURLvolume("songus",0.5)
  29. if(OK==1){
  30. for(I=1,14){
  31. FT = FFT:number(I)
  32. holoScale(I,vec(0.1,0.1,max(0.1,min(FT/100,0.95))))
  33. holoColor(I,hsv2rgb(FT,1,1))
  34. }
  35. if(changed(FFT:max()==0) && FFT:max()==0){
  36. Last = curtime()
  37. }
  38. if(FFT:max()==0 && curtime()-Last>3){
  39. Last = curtime()
  40. soundURLdelete("songus")
  41. soundURLplay("songus")
  42. soundURLload("songus",URL,100,0,E)
  43. }
  44. }elseif(OK==0){
  45. for(I=1,14){
  46. holoScale(I,vec(0.1,0.1,max(0.1,min(easeOutQuad(cos(I*20+curtime()*200))*5,0.95))))
  47. holoColor(I,hsv2rgb(curtime()/14*I,1,1))
  48. }
  49. }else{
  50. for(I=1,14){
  51. holoScale(I,vec(0.1,0.1,max(0.1,min(sin(I*100+curtime()*100),0.95))))
  52. holoColor(I,hsv2rgb(sin(I*100+curtime()*10)*255,1,1))
  53. }
  54. }
  55. runOnLast(1)
  56. if(last()){soundURLdelete("songus")}
  57.  
  58. runOnSoundURL(1)
  59. if(soundURLClk()){
  60. if(soundURLSuccess()){
  61. OK = 1
  62. }elseif(!soundURLSuccess()){
  63. timer("timeout",3000)
  64. }
  65. }
  66. if(clk("timeout")){
  67. if(OK==0){
  68. soundPlay(1,1,"buttons/button10.wav")
  69. OK=-1
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement