Advertisement
Toastur

Toast's Dual Windscreen Wipers [Gmod E2]

Mar 12th, 2017
512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.05 KB | None | 0 0
  1. @name Toast's Dual 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,-SplitDistance,0)))
  25.  
  26. holoCreate(1)
  27. holoScale(1,vec(0))
  28. holoParent(1, entity())
  29. holoPos(1,entity():toWorld(vec(0,SplitDistance,0)))
  30.  
  31.  
  32. A = 2
  33. holoCreate(A, entity():toWorld(vec(0,-SplitDistance,0)), vec(1),
  34. entity():toWorld(ang(0,0,0)))
  35. holoColor(A, Color)
  36. holoModel(A, "models/sprops/cylinders/size_2/cylinder_3x3.mdl")
  37. holoScale(A, vec(0.4,0.4,0.4))
  38. holoParent(A, 0)
  39. holoMaterial(A,Material)
  40.  
  41. A = 3
  42. holoCreate(A, entity():toWorld(vec(BarLength,-SplitDistance,0.2)), vec(1),
  43. entity():toWorld(ang(1.5,0,0)))
  44. holoColor(A, Color)
  45. holoModel(A, "models/sprops/rectangles/size_1/rect_3x30x3.mdl")
  46. holoScale(A, vec(BarLength/15,0.17,0.05))
  47. holoParent(A, 0)
  48. holoMaterial(A,Material)
  49.  
  50. A = 4
  51. holoCreate(A, entity():toWorld(vec(BarLength*2,-SplitDistance,0)), vec(1),
  52. entity():toWorld(ang(0,0,0)))
  53. holoColor(A, Color)
  54. holoModel(A, "models/sprops/cylinders/size_2/cylinder_3x3.mdl")
  55. holoScale(A, vec(0.3,0.3,0.2))
  56. holoParent(A, 0)
  57. holoMaterial(A,Material)
  58.  
  59. A = 5
  60. holoCreate(A, entity():toWorld(vec(BarLength*2,-SplitDistance,-0.13)), vec(1),
  61. entity():toWorld(ang(0,0,0)))
  62. holoColor(A, Color)
  63. holoModel(A, "models/sprops/rectangles/size_1/rect_3x30x3.mdl")
  64. holoScale(A, vec(WiperLength/15,0.17,0.1))
  65. holoParent(A, 0)
  66. holoMaterial(A,Material)
  67.  
  68. A = 6
  69. holoCreate(A, entity():toWorld(vec(0,SplitDistance,0)), vec(1),
  70. entity():toWorld(ang(0,0,0)))
  71. holoColor(A, Color)
  72. holoModel(A, "models/sprops/cylinders/size_2/cylinder_3x3.mdl")
  73. holoScale(A, vec(0.4,0.4,0.4))
  74. holoParent(A, 1)
  75. holoMaterial(A,Material)
  76.  
  77. A = 7
  78. holoCreate(A, entity():toWorld(vec(BarLength,SplitDistance,0.2)), vec(1),
  79. entity():toWorld(ang(1.5,0,0)))
  80. holoColor(A, Color)
  81. holoModel(A, "models/sprops/rectangles/size_1/rect_3x30x3.mdl")
  82. holoScale(A, vec(BarLength/15,0.17,0.05))
  83. holoParent(A, 1)
  84. holoMaterial(A,Material)
  85.  
  86. A = 8
  87. holoCreate(A, entity():toWorld(vec(BarLength*2,SplitDistance,0)), vec(1),
  88. entity():toWorld(ang(0,0,0)))
  89. holoColor(A, Color)
  90. holoModel(A, "models/sprops/cylinders/size_2/cylinder_3x3.mdl")
  91. holoScale(A, vec(0.3,0.3,0.2))
  92. holoParent(A, 1)
  93. holoMaterial(A,Material)
  94.  
  95. A = 9
  96. holoCreate(A, entity():toWorld(vec(BarLength*2,SplitDistance,-0.13)), vec(1),
  97. entity():toWorld(ang(0,0,0)))
  98. holoColor(A, Color)
  99. holoModel(A, "models/sprops/rectangles/size_1/rect_3x30x3.mdl")
  100. holoScale(A, vec(WiperLength/15,0.17,0.1))
  101. holoParent(A, 1)
  102. holoMaterial(A,Material)
  103.  
  104. holoCreate(10)
  105. holoScale(10,vec(0))
  106. holoParent(10, entity())
  107.  
  108.  
  109. A = 11
  110. holoCreate(A, entity():toWorld(vec(BarLength,0,0.18)), vec(1),
  111. entity():toWorld(ang(0,90,1.5)))
  112. holoColor(A, Color)
  113. holoModel(A, "models/sprops/rectangles/size_1/rect_3x30x3.mdl")
  114. holoScale(A, vec(SplitDistance/15,0.17,0.05))
  115. holoParent(A, 10)
  116. holoMaterial(A,Material)
  117. }
  118.  
  119. function number wiperClk() {
  120. return (On)
  121. }
  122.  
  123. if(wiperClk()){
  124. interval(100)
  125. if(clk()){
  126. if(On){
  127. soundPlay(0,0,Sound)
  128. Wipe = sin(curtime() * (Speed*10))*Coverage
  129. }elseif(!On){
  130. Wipe = -20
  131. }
  132. }
  133. }else{
  134. Wipe = SpawnAng
  135. soundStop(0)
  136. }
  137.  
  138. holoAng(0,entity():toWorld(ang(0,0-Wipe,0)))
  139. holoAng(1,entity():toWorld(ang(0,0-Wipe,0)))
  140. holoAng(10,entity():toWorld(ang(0,0-Wipe,0)))
  141. holoAng(11,entity():toWorld(ang(0,90,0)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement