Advertisement
Toastur

Ball Signal [Gmod E2]

Jun 25th, 2017
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.99 KB | None | 0 0
  1. @name Toast's Ball Signal
  2. @inputs Ball1 Ball2
  3. @outputs
  4. @persist Ball1Pos Ball2Pos
  5. @trigger
  6.  
  7. if(first() | dupefinished()){
  8.  
  9. Color = vec(250,250,250)
  10. Material = "WTP/wood_1a"
  11.  
  12. A = 1
  13. holoCreate(A, entity():toWorld(vec(0,0,96)), vec(1),
  14. entity():toWorld(ang(90,0,0)))
  15. holoColor(A, Color)
  16. holoModel(A, "models/sprops/cuboids/height12/size_1/cube_12x192x12.mdl")
  17. holoScale(A, vec(1,1,1))
  18. holoParent(A, entity())
  19. holoMaterial(A,Material)
  20.  
  21. A = 2
  22. holoCreate(A, entity():toWorld(vec(0,7.5,185)), vec(1),
  23. entity():toWorld(ang(0,0,90)))
  24. holoColor(A, Color)
  25. holoModel(A, "models/sprops/rectangles/size_1_5/rect_6x78x3.mdl")
  26. holoScale(A, vec(1,1,1))
  27. holoParent(A, entity())
  28. holoMaterial(A,Material)
  29.  
  30. A = 3
  31. holoCreate(A, entity():toWorld(vec(0,-7.5,185)), vec(1),
  32. entity():toWorld(ang(0,0,90)))
  33. holoColor(A, Color)
  34. holoModel(A, "models/sprops/rectangles/size_1_5/rect_6x78x3.mdl")
  35. holoScale(A, vec(1,1,1))
  36. holoParent(A, entity())
  37. holoMaterial(A,Material)
  38.  
  39. A = 4
  40. holoCreate(A, entity():toWorld(vec(0,7.5,36)), vec(1),
  41. entity():toWorld(ang(0,0,90)))
  42. holoColor(A, Color)
  43. holoModel(A, "models/sprops/rectangles/size_1_5/rect_6x78x3.mdl")
  44. holoScale(A, vec(1,1,1))
  45. holoParent(A, entity())
  46. holoMaterial(A,Material)
  47.  
  48. A = 5
  49. holoCreate(A, entity():toWorld(vec(0,-7.5,36)), vec(1),
  50. entity():toWorld(ang(0,0,90)))
  51. holoColor(A, Color)
  52. holoModel(A, "models/sprops/rectangles/size_1_5/rect_6x78x3.mdl")
  53. holoScale(A, vec(1,1,1))
  54. holoParent(A, entity())
  55. holoMaterial(A,Material)
  56.  
  57. A = 6
  58. holoCreate(A, entity():toWorld(vec(-13,6.5,178)), vec(1),
  59. entity():toWorld(ang(35,0,90)))
  60. holoColor(A, Color)
  61. holoModel(A, "models/sprops/rectangles_thin/size_1/rect_3x24x1_5.mdl")
  62. holoScale(A, vec(1,1,1))
  63. holoParent(A, entity())
  64. holoMaterial(A,Material)
  65.  
  66. A = 7
  67. holoCreate(A, entity():toWorld(vec(-13,6.5,178)), vec(1),
  68. entity():toWorld(ang(35,0,90)))
  69. holoColor(A,Color)
  70. holoModel(A, "models/sprops/rectangles_thin/size_1/rect_3x24x1_5.mdl")
  71. holoScale(A, vec(1,1,1))
  72. holoParent(A, entity())
  73. holoMaterial(A,Material)
  74.  
  75. A = 8
  76. holoCreate(A, entity():toWorld(vec(13,6.5,178)), vec(1),
  77. entity():toWorld(ang(-35,0,90)))
  78. holoColor(A, Color)
  79. holoModel(A, "models/sprops/rectangles_thin/size_1/rect_3x24x1_5.mdl")
  80. holoScale(A, vec(1,1,1))
  81. holoParent(A, entity())
  82. holoMaterial(A,Material)
  83.  
  84. A = 9
  85. holoCreate(A, entity():toWorld(vec(13,-6.5,178)), vec(1),
  86. entity():toWorld(ang(-35,0,90)))
  87. holoColor(A, Color)
  88. holoModel(A, "models/sprops/rectangles_thin/size_1/rect_3x24x1_5.mdl")
  89. holoScale(A, vec(1,1,1))
  90. holoParent(A, entity())
  91. holoMaterial(A,Material)
  92.  
  93. A = 10
  94. holoCreate(A, entity():toWorld(vec(30,0,185)), vec(1),
  95. entity():toWorld(ang(0,90,0)))
  96. holoColor(A, vec4(255,255,255,255))
  97. holoModel(A, "models/props_c17/pulleywheels_small01.mdl")
  98. holoScale(A, vec(1,1,1))
  99. holoParent(A, entity())
  100. holoMaterial(A,"")
  101.  
  102. A = 11
  103. holoCreate(A, entity():toWorld(vec(-30,0,185)), vec(1),
  104. entity():toWorld(ang(0,90,0)))
  105. holoColor(A, vec4(255,255,255,255))
  106. holoModel(A, "models/props_c17/pulleywheels_small01.mdl")
  107. holoScale(A, vec(1,1,1))
  108. holoParent(A, entity())
  109. holoMaterial(A,"")
  110.  
  111. A = 12
  112. holoCreate(A, entity():toWorld(vec(30,0,36)), vec(1),
  113. entity():toWorld(ang(0,90,0)))
  114. holoColor(A, vec4(255,255,255,255))
  115. holoModel(A, "models/props_c17/pulleywheels_small01.mdl")
  116. holoScale(A, vec(1,1,1))
  117. holoParent(A, entity())
  118. holoMaterial(A,"")
  119.  
  120. A = 13
  121. holoCreate(A, entity():toWorld(vec(-30,0,36)), vec(1),
  122. entity():toWorld(ang(0,90,0)))
  123. holoColor(A, vec4(255,255,255,255))
  124. holoModel(A, "models/props_c17/pulleywheels_small01.mdl")
  125. holoScale(A, vec(1,1,1))
  126. holoParent(A, entity())
  127. holoMaterial(A,"")
  128.  
  129. A = 14
  130. holoCreate(A, entity():toWorld(vec(30,0,185)), vec(1),
  131. entity():toWorld(ang(0,0,0)))
  132. holoColor(A, vec4(36,36,36,255))
  133. holoModel(A, "models/sprops/geometry/fring_84.mdl")
  134. holoScale(A, vec(0.21,0.59,0.21))
  135. holoParent(A, entity())
  136. holoMaterial(A,"WTP/metal_2")
  137.  
  138. A = 15
  139. holoCreate(A, entity():toWorld(vec(-30,0,185)), vec(1),
  140. entity():toWorld(ang(0,0,0)))
  141. holoColor(A, vec4(36,36,36,255))
  142. holoModel(A, "models/sprops/geometry/fring_84.mdl")
  143. holoScale(A, vec(0.21,0.59,0.21))
  144. holoParent(A, entity())
  145. holoMaterial(A,"WTP/metal_2")
  146.  
  147. A = 16
  148. holoCreate(A, entity():toWorld(vec(30,0,36)), vec(1),
  149. entity():toWorld(ang(0,0,0)))
  150. holoColor(A, vec4(36,36,36,255))
  151. holoModel(A, "models/sprops/geometry/fring_84.mdl")
  152. holoScale(A, vec(0.21,0.59,0.21))
  153. holoParent(A, entity())
  154. holoMaterial(A,"WTP/metal_2")
  155.  
  156. A = 17
  157. holoCreate(A, entity():toWorld(vec(-30,0,36)), vec(1),
  158. entity():toWorld(ang(0,0,0)))
  159. holoColor(A, vec4(36,36,36,255))
  160. holoModel(A, "models/sprops/geometry/fring_84.mdl")
  161. holoScale(A, vec(0.21,0.59,0.21))
  162. holoParent(A, entity())
  163. holoMaterial(A,"WTP/metal_2")
  164.  
  165. A = 18
  166. holoCreate(A, entity():toWorld(vec(-38,0,111)), vec(1),
  167. entity():toWorld(ang(0,0,0)))
  168. holoColor(A, vec4(36,36,36,255))
  169. holoModel(A, "models/sprops/cylinders/size_1/cylinder_1_5x144.mdl")
  170. holoScale(A, vec(1,1,1))
  171. holoParent(A, entity())
  172. holoMaterial(A,"WTP/metal_2")
  173.  
  174. A = 19
  175. holoCreate(A, entity():toWorld(vec(-22,0,111)), vec(1),
  176. entity():toWorld(ang(0,0,0)))
  177. holoColor(A, vec4(36,36,36,255))
  178. holoModel(A, "models/sprops/cylinders/size_1/cylinder_1_5x144.mdl")
  179. holoScale(A, vec(1,1,1))
  180. holoParent(A, entity())
  181. holoMaterial(A,"WTP/metal_2")
  182.  
  183. A = 20
  184. holoCreate(A, entity():toWorld(vec(38,0,111)), vec(1),
  185. entity():toWorld(ang(0,0,0)))
  186. holoColor(A, vec4(36,36,36,255))
  187. holoModel(A, "models/sprops/cylinders/size_1/cylinder_1_5x144.mdl")
  188. holoScale(A, vec(1,1,1))
  189. holoParent(A, entity())
  190. holoMaterial(A,"WTP/metal_2")
  191.  
  192. A = 21
  193. holoCreate(A, entity():toWorld(vec(22,0,111)), vec(1),
  194. entity():toWorld(ang(0,0,0)))
  195. holoColor(A, vec4(36,36,36,255))
  196. holoModel(A, "models/sprops/cylinders/size_1/cylinder_1_5x144.mdl")
  197. holoScale(A, vec(1,1,1))
  198. holoParent(A, entity())
  199. holoMaterial(A,"WTP/metal_2")
  200. #Left nut
  201. A = 22
  202. holoCreate(A, entity():toWorld(vec(38,0,65)), vec(1),
  203. entity():toWorld(ang(0,0,0)))
  204. holoColor(A, vec4(255,36,36,255))
  205. holoModel(A, "models/sprops/geometry/sphere_24.mdl")
  206. holoScale(A, vec(1,1,1))
  207. holoParent(A, entity())
  208. holoMaterial(A,"WTP/metal_2")
  209. #Right nut
  210. A = 23
  211. holoCreate(A, entity():toWorld(vec(-38,0,65)), vec(1),
  212. entity():toWorld(ang(0,0,0)))
  213. holoColor(A, vec4(255,36,36,255))
  214. holoModel(A, "models/sprops/geometry/sphere_24.mdl")
  215. holoScale(A, vec(1,1,1))
  216. holoParent(A, entity())
  217. holoMaterial(A,"WTP/metal_2")
  218. }
  219. function number canClk() {
  220. return (Ball1Pos != Ball1 |Ball1Pos != Ball2)
  221. }
  222.  
  223. if(canClk()){
  224. interval(100)
  225. if(clk()){
  226. if(Ball1Pos != Ball1) {
  227. Ball1Pos += Ball1Pos > Ball1 ? -0.05 : 0.05
  228. Ball1Pos = clamp(Ball1Pos,0,1)
  229. holoPos(22,entity():toWorld(vec(38,0,65+Ball1Pos*90)))
  230. holoAng(10,entity():toWorld(ang(0,90,-Ball1Pos*180)))
  231. holoAng(12,entity():toWorld(ang(0,90,-Ball1Pos*180)))
  232. }
  233. if(Ball2Pos != Ball2) {
  234. Ball2Pos += Ball2Pos > Ball2 ? -0.05 : 0.05
  235. Ball2Pos = clamp(Ball2Pos,0,1)
  236. holoPos(23,entity():toWorld(vec(-38,0,65+Ball2Pos*90)))
  237. holoAng(11,entity():toWorld(ang(0,90,Ball2Pos*180)))
  238. holoAng(13,entity():toWorld(ang(0,90,Ball2Pos*180)))
  239. }
  240. }
  241. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement