Advertisement
Toastur

Toast's Windscreen Wiper [Gmod E2]

Mar 12th, 2017
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. @name Toast's Windscreen Wiper
  2. @inputs On
  3. @outputs
  4. @persist Sound:string Color:vector Material:string Coverage Speed SpawnAng
  5. @trigger
  6.  
  7.  
  8. if(first() | dupefinished()){
  9.  
  10. Coverage = 50
  11. Speed = 30
  12. SpawnAng = 50
  13.  
  14. Sound = ""
  15. Color = vec(30,30,30)
  16. Material = "WTP/metal_2"
  17. BarLength = 6
  18. WiperLength = 6
  19. SplitDistance = 20
  20.  
  21. holoCreate(0)
  22. holoScale(0,vec(0))
  23. holoParent(0, entity())
  24. holoPos(0,entity():toWorld(vec(0,0.4,0)))
  25.  
  26. holoCreate(1)
  27. holoScale(1,vec(0))
  28. holoParent(1, entity())
  29. holoPos(1,entity():toWorld(vec(0,-0.3,0)))
  30.  
  31. A = 2
  32. holoCreate(A, entity():toWorld(vec(0,0.4,0)), vec(1),
  33. entity():toWorld(ang(0,0,0)))
  34. holoColor(A, Color)
  35. holoModel(A, "models/sprops/cylinders/size_2/cylinder_3x3.mdl")
  36. holoScale(A, vec(0.4,0.4,0.4))
  37. holoParent(A, entity())
  38. holoMaterial(A,Material)
  39.  
  40. A = 3
  41. holoCreate(A, entity():toWorld(vec(0,-0.3,0)), vec(1),
  42. entity():toWorld(ang(0,0,0)))
  43. holoColor(A, Color)
  44. holoModel(A, "models/sprops/cylinders/size_2/cylinder_3x3.mdl")
  45. holoScale(A, vec(0.3,0.3,0.4))
  46. holoParent(A, entity())
  47. holoMaterial(A,Material)
  48.  
  49. A = 4
  50. holoCreate(A, entity():toWorld(vec(BarLength,0.4,0.2)), vec(1),
  51. entity():toWorld(ang(0,0,0)))
  52. holoColor(A, Color)
  53. holoModel(A, "models/sprops/rectangles/size_1/rect_3x30x3.mdl")
  54. holoScale(A, vec(BarLength/15,0.1,0.05))
  55. holoParent(A, 0)
  56. holoMaterial(A,Material)
  57.  
  58. A = 5
  59. holoCreate(A, entity():toWorld(vec(BarLength,-0.3,0.2)), vec(1),
  60. entity():toWorld(ang(0,0,0)))
  61. holoColor(A, Color)
  62. holoModel(A, "models/sprops/rectangles/size_1/rect_3x30x3.mdl")
  63. holoScale(A, vec(BarLength/15,0.06,0.05))
  64. holoParent(A, 1)
  65. holoMaterial(A,Material)
  66.  
  67. holoCreate(6)
  68. holoScale(6,vec(0))
  69. holoParent(6, entity())
  70. holoPos(6,entity():toWorld(vec(0,0,0)))
  71.  
  72. A = 7
  73. holoCreate(A, entity():toWorld(vec(BarLength*2,0,0.2)), vec(1),
  74. entity():toWorld(ang(0,0,0)))
  75. holoColor(A, Color)
  76. holoModel(A, "models/sprops/rectangles/size_1/rect_3x30x3.mdl")
  77. holoScale(A, vec(0.04,0.08,0.06))
  78. holoParent(A, 6)
  79. holoMaterial(A,Material)
  80.  
  81. A = 8
  82. holoCreate(A, entity():toWorld(vec(BarLength*2,0.3,0)), vec(1),
  83. entity():toWorld(ang(0,0,0)))
  84. holoColor(A, Color)
  85. holoModel(A, "models/sprops/rectangles/size_1/rect_3x30x3.mdl")
  86. holoScale(A, vec(WiperLength/15,0.13,0.09))
  87. holoParent(A, 6)
  88. holoMaterial(A,Material)
  89. Wipe = SpawnAng
  90. }
  91. function number wiperClk() {
  92. return (On)
  93. }
  94.  
  95. if(wiperClk()){
  96. interval(100)
  97. if(clk()){
  98. if(On){
  99. soundPlay(0,0,Sound)
  100. Wipe = sin(curtime() * (Speed*10))*Coverage
  101. }
  102. }
  103. }else{
  104. Wipe = SpawnAng
  105. soundStop(0)
  106. }
  107.  
  108.  
  109. holoAng(0,entity():toWorld(ang(0,-Wipe,0)))
  110. holoAng(1,entity():toWorld(ang(0,-Wipe,0)))
  111. holoAng(6,entity():toWorld(ang(0,-Wipe,0)))
  112.  
  113. holoAng(7,entity():toWorld(ang(0,90,0)))
  114. holoAng(8,entity():toWorld(ang(0,0,0)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement