Cheesecaked

Untitled Goose

Aug 8th, 2022
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.74 KB | None | 0 0
  1. @name Untitled Goose
  2. @persist Filter:array Walk Curtime
  3.  
  4. Exp = entity()
  5. E = entity():isWeldedTo()
  6. D = E:driver()
  7.  
  8. BC = E:boxCenterW()
  9. Up = E:up()
  10. Right = E:right()
  11. Forward = E:forward()
  12.  
  13. Speed = 300
  14.  
  15. if(first()|dupefinished()){
  16. runOnTick(1)
  17.  
  18. function angle etwa(A:angle){
  19. return E:toWorld(A)
  20. }
  21. function vector tw(N:number,V:vector){
  22. return holoEntity(N):toWorld(V)
  23. }
  24. function angle twa(N:number,A:angle){
  25. return holoEntity(N):toWorld(A)
  26. }
  27. function vector bc(N:number){
  28. return holoEntity(N):boxCenterW()
  29. }
  30.  
  31. Exp:setMass(0)
  32. E:setMass(500)
  33.  
  34. Model = array("","hqsphere","hqsphere","hqsphere","hqsphere",
  35. "hqrcylinder","hqrcylinder","hqrcylinder","hqrcylinder","hqrcylinder",
  36. "hqrcylinder","hqrcylinder","hqrcylinder","hqrcylinder","hqsphere",
  37. "hqrcylinder","hqrcylinder","hqrcylinder","hqrcylinder","hqrcylinder",
  38. "hqrcylinder","hqrcylinder","hqsphere","hqsphere","hqsphere",
  39. "hqsphere","hqsphere","hqsphere","hq_rcube","hq_rcube",
  40. "hq_rcube","","hqsphere","hqrcylinder","hqrcylinder",
  41. "hqrcylinder","hqrcylinder","hq_cone","","hqsphere",
  42. "hqrcylinder","hqrcylinder","hqrcylinder","hqrcylinder","hq_cone")
  43.  
  44. holoCreate(1,BC - Up*10,vec(),etwa(ang(0,90,0)))
  45. holoParent(1,E)
  46. holoCreate(100000,bc(1),vec(),twa(1,ang()))
  47. holoParent(100000,1)
  48. holoCreate(2,tw(1,vec(0,0,-18)),vec(5,3,3),twa(1,ang(-10,0,0)),vec(255),"hqsphere")
  49. holoParent(2,100000)
  50. holoCreate(3,tw(2,vec(-30,0,6)),vec(2,2,4/12),twa(1,ang(10,0,0)),vec(255),"hqsphere")
  51. holoParent(3,2)
  52. holoCreate(4,tw(3,vec(1,0,2)),holoScale(3),twa(3,ang(15,0,0)),vec(255),"hqsphere")
  53. holoParent(4,3)
  54.  
  55. holoCreate(5,tw(1,vec(21,0,-7.5)),vec(18/12,1,15/12),twa(1,ang()),vec(255),"hqsphere")
  56. holoParent(5,2)
  57. holoCreate(6,tw(5,vec(2,0,0)),vec(10/12,10/12,8/12),twa(1,vec(3,0,2):toAngle()+ang(90,0,0)),vec(255),"hqrcylinder")
  58. holoParent(6,5)
  59.  
  60. for(H = 7,14){
  61. holoCreate(H,tw(H - 1,vec(0,0,3)),vec((10-0.7*(H-6))/12,(10-0.5*(H-6))/12,8.5/12),twa(H-1,ang(-7,0,0)),vec(255),"hqrcylinder")
  62. holoParent(H,H-1)
  63. }
  64.  
  65. holoCreate(15,tw(14,vec(0,0,3.5)),holoScale(14),twa(1,ang()),vec(255),"hqsphere")
  66. holoParent(15,14)
  67.  
  68. for(H = 16,22){
  69. holoCreate(H,tw(H - 1,vec(0,0,2)),(holoScale(H-1)+vec(0.1/12,0.05/12,0)):setZ(4/12),twa(H-1,ang(7,0,0)),vec(255),"hqrcylinder")
  70. holoParent(H,H-1)
  71. }
  72.  
  73. holoCreate(23,tw(22,vec(0,0,2)),vec(6/12,6/12,6/12),twa(1,ang()),vec(255),"hqsphere")
  74. holoParent(23,22)
  75. holoCreate(24,tw(23,vec(2,0,0)),vec(11/12,8/12,8/12),twa(23,ang(1,0,0)),vec(255),"hqsphere")
  76. holoParent(24,23)
  77. holoCreate(25,tw(24,vec(3,3,1)),vec(1.5/12),twa(1,ang()),vec(),"hqsphere")
  78. holoParent(25,24)
  79. holoCreate(26,tw(24,vec(3,-3,1)),vec(1.5/12),twa(1,ang()),vec(),"hqsphere")
  80. holoParent(26,24)
  81.  
  82. holoCreate(27,tw(24,vec(6,0,-1)),vec(5/12,3/12,1/12),twa(23,ang(2,0,0)),vec(255,130,0),"hqsphere")
  83. holoParent(27,24)
  84. holoCreate(28,tw(24,vec(6,0,-1.5)),vec(5/12,3/12,1/12),twa(23,ang(-2,0,0)),vec(255,130,0),"hqsphere")
  85. holoParent(28,24)
  86.  
  87. holoCreate(29,tw(24,vec(30,0,2)),vec(2,1.5/24,1.5/24),(tw(24,vec()) - tw(24,vec(30,0,2))):toAngle():setRoll(0),vec(255),"hq_rcube")
  88. holoParent(29,24)
  89. holoCreate(30,tw(29,vec(0,0,12)),vec(2,1.5/24,1.5/24),(tw(24,vec()) - tw(29,vec(0,0,12))):toAngle():setRoll(0),vec(255),"hq_rcube")
  90. holoParent(30,24)
  91. holoCreate(31,tw(29,vec(0,0,-12)),vec(2,1.5/24,1.5/24),(tw(24,vec()) - tw(29,vec(0,0,-12))):toAngle():setRoll(0),vec(255),"hq_rcube")
  92. holoParent(31,24)
  93.  
  94. Ang1 = 100
  95. Ang2 = 50
  96. L1 = 30-12*sin(Ang1)
  97. L2 = L1 - (L1 - 18)*sin(Ang2)
  98. holoCreate(32,tw(2,vec(cos(Ang1)*L2*cos(Ang2),sin(Ang1)*L2*cos(Ang2),-L2*sin(Ang2) + 3)),vec(3/12),twa(1,ang()),vec(),"hqsphere")
  99. holoParent(32,2)
  100. holoCreate(33,tw(32,vec(0,-1,3)),vec(15/12,15/12,2),twa(1,ang()),vec(255),"hqsphere")
  101. holoParent(33,32)
  102. holoCreate(34,tw(33,vec(0,0,-12-6)),vec(3/12,3/12,18/12),twa(1,ang()),vec(255,130,0),"hqrcylinder")
  103. holoParent(34,33)
  104. holoCreate(35,tw(34,vec(6,0,-8)),vec(2/12,3/12,1),twa(34,ang(-90,0,0)),vec(255,130,0),"hqrcylinder")
  105. holoParent(35,34)
  106. V36 = tw(34,vec(cos(30)*6,sin(30)*6,-8))
  107. holoCreate(36,V36,vec(2/12,3/12,1),(tw(34,vec(0,0,-8)) - V36):toAngle()+ang(-90,0,0),vec(255,130,0),"hqrcylinder")
  108. holoParent(36,34)
  109. V37 = tw(34,vec(cos(-30)*6,sin(-30)*6,-8))
  110. holoCreate(37,V37,vec(2/12,3/12,1),(tw(34,vec(0,0,-8)) - V37):toAngle()+ang(-90,0,0),vec(255,130,0),"hqrcylinder")
  111. holoParent(37,34)
  112. holoCreate(38,tw(35,vec(-0.1,0,1)),vec(1/12,8/12,8/12),twa(35,ang()),vec(255,130,0),"hq_cone")
  113. holoParent(38,34)
  114.  
  115. holoCreate(39,tw(2,vec(cos(-Ang1)*L2*cos(Ang2),sin(-Ang1)*L2*cos(Ang2),-L2*sin(Ang2) + 3)),vec(3/12),twa(1,ang()),vec(),"hqsphere")
  116. holoParent(39,2)
  117. holoCreate(40,tw(39,vec(0,-1,3)),vec(15/12,15/12,2),twa(1,ang()),vec(255),"hqsphere")
  118. holoParent(40,39)
  119. holoCreate(41,tw(40,vec(0,0,-12-6)),vec(3/12,3/12,18/12),twa(1,ang()),vec(255,130,0),"hqrcylinder")
  120. holoParent(41,40)
  121. holoCreate(42,tw(41,vec(6,0,-8)),vec(2/12,3/12,1),twa(41,ang(-90,0,0)),vec(255,130,0),"hqrcylinder")
  122. holoParent(42,41)
  123. V43 = tw(41,vec(cos(30)*6,sin(30)*6,-8))
  124. holoCreate(43,V43,vec(2/12,3/12,1),(tw(41,vec(0,0,-8)) - V43):toAngle()+ang(-90,0,0),vec(255,130,0),"hqrcylinder")
  125. holoParent(43,41)
  126. V44 = tw(41,vec(cos(-30)*6,sin(-30)*6,-8))
  127. holoCreate(44,V44,vec(2/12,3/12,1),(tw(41,vec(0,0,-8)) - V44):toAngle()+ang(-90,0,0),vec(255,130,0),"hqrcylinder")
  128. holoParent(44,41)
  129. holoCreate(45,tw(42,vec(-0.1,0,1)),vec(1/12,8/12,8/12),twa(42,ang()),vec(255,130,0),"hq_cone")
  130. holoParent(45,41)
  131.  
  132. for(H = 2,5){
  133. holoCreate(100 + H,bc(H),-holoScale(H)-vec(1/12),twa(H,ang()),vec(),Model[H,string])
  134. holoDisableShading(100 + H,1)
  135. holoParent(100 + H,H)
  136. }
  137. for(H = 6,22){
  138. if(H%3 == 1){
  139. holoCreate(100 + H,bc(H),-holoScale(H)-vec(1.5/12,1.5/12,3/12),twa(H,ang()),vec(),Model[H,string])
  140. holoDisableShading(100 + H,1)
  141. holoParent(100 + H,H)
  142. }
  143. }
  144. for(H = 23,24){
  145. holoCreate(100 + H,bc(H),-holoScale(H)-vec(1/12),twa(H,ang()),vec(),Model[H,string])
  146. holoDisableShading(100 + H,1)
  147. holoParent(100 + H,H)
  148. }
  149. for(H = 27,45){
  150. if(H != 32 & H != 39){
  151. if(H == 38|H == 45){
  152. holoCreate(100 + H,bc(H),-holoScale(H)-vec(1/12),twa(H,ang(180,0,0)),vec(),Model[H,string])
  153. holoDisableShading(100 + H,1)
  154. holoParent(100 + H,H)
  155. }
  156. else{
  157. holoCreate(100 + H,bc(H),-holoScale(H)-vec(1/12),twa(H,ang()),vec(),Model[H,string])
  158. holoDisableShading(100 + H,1)
  159. holoParent(100 + H,H)
  160. }
  161. }
  162. }
  163.  
  164. for(H = 29,31){
  165. holoAlpha(H,0)
  166. holoAlpha(100 + H,0)
  167. }
  168.  
  169. for(H = 2,50){
  170. holoDisableShading(H,1)
  171. }
  172. }
  173. else{
  174. findByClass("gmod_wire_turret")
  175.  
  176. rangerFilter(E)
  177.  
  178. rangerHitEntities(1)
  179. R1 = 55
  180. Ranger1 = rangerOffset(bc(1),bc(1) - vec(0,0,R1))
  181.  
  182. rangerHitEntities(0)
  183. Ranger2 = rangerOffsetHull(BC + vec(0,0,10),BC + vec(0,0,15),vec(10,10,5))
  184. Ranger3 = rangerOffsetHull(BC + Forward * 25 - Up * 5,BC + Forward * 25 - Up * 5,vec(10,10,5))
  185. Ranger4 = rangerOffsetHull(BC + vec(0,0,10),BC + vec(0,0,15),vec(10,10,5))
  186.  
  187. if(!first()&!dupefinished()){
  188. if(changed(D)){
  189. if(D:isValid()){
  190. Exp:setAlpha(0)
  191. E:setAlpha(0)
  192. }
  193. else{
  194. Exp:setAlpha(255)
  195. E:setAlpha(255)
  196. }
  197. }
  198.  
  199. if(changed(D:keyAttack1())){
  200. if(D:keyAttack1()){
  201. E:soundPlay(1,0,"synth/tri.wav")
  202. soundPitch(1,112)
  203. soundVolume(1,0.8)
  204.  
  205. stoptimer("honk")
  206. }
  207. else{
  208. timer("honk",2)
  209. }
  210. }
  211.  
  212. if(D:keyAttack1()){
  213. for(H = 29,31){
  214. holoAlpha(H,255)
  215. holoAlpha(100 + H,255)
  216. holoPos(28,tw(24,vec(6,0,-2)))
  217. holoAng(28,twa(23,ang(30,0,0)))
  218. }
  219. }
  220. else{
  221. for(H = 29,31){
  222. holoAlpha(H,0)
  223. holoAlpha(100 + H,0)
  224. holoPos(28,tw(24,vec(6,0,-1.5)))
  225. holoAng(28,twa(23,ang(-2,0,0)))
  226. }
  227. }
  228.  
  229. if(D:keyForward()|D:keyLeft()){
  230. if(Walk != -1){
  231. Walk = 1
  232. }
  233. }
  234. elseif(D:keyBack()|D:keyRight()){
  235. if(Walk != 1){
  236. Walk = -1
  237. }
  238. }
  239.  
  240. #CurtimeP =
  241.  
  242. if(changed(Walk)){
  243.  
  244. }
  245. else{
  246. if(!D:isValid()){
  247. Walk = 0
  248. }
  249. elseif(Walk == 1|Walk == -1){
  250. if(Curtime >= 150){
  251. if(Curtime%180 >= 172|Curtime%180 <= 8){
  252. if((!D:keyForward() & !D:keyBack() & !D:keyLeft() & !D:keyRight())){
  253. Walk = 0
  254. }
  255. }
  256. }
  257. }
  258. }
  259.  
  260. if(Walk == 0){
  261. holoAng(1,etwa(ang(0,90,0)))
  262. }
  263. else{
  264. Curtime += 15
  265. if(Walk == 1){
  266. holoAng(100000,twa(1,ang(sin(Curtime*2)*10,sin(Curtime)*30,0)))
  267. holoAng(32,twa(1,ang(sin(Curtime*2)*40,0,0)))
  268. holoAng(39,twa(1,ang(-sin(Curtime*2)*40,0,0)))
  269. }
  270. elseif(Walk == -1){
  271. holoAng(100000,twa(1,ang(-sin(Curtime*2)*10,-sin(Curtime)*30,0)))
  272. holoAng(32,twa(1,ang(-sin(Curtime*2)*40,0,0)))
  273. holoAng(39,twa(1,ang(sin(Curtime*2)*40,0,0)))
  274. }
  275. }
  276. }
  277.  
  278. Movement = D:isValid()*(Forward * D:keyForward() - Forward * !D:keyForward() * D:keyBack())
  279. UMovement = D:isValid()*(Up * D:keyJump() * (1 - 0.8 * !Ranger1:hit()))
  280. E:applyForce(((-E:vel()*0.8):setZ((-E:vel():z() + (R1 - Ranger1:distance())*10) * Ranger1:hit()) + vec(0,0,(-E:vel():z() - 1000) * Ranger2:hit() * D:isValid()) + Movement * Speed + UMovement * 200)*E:mass())
  281.  
  282. AMovement = D:isValid()*(D:keyLeft() - !D:keyLeft() * D:keyRight())
  283. Local = E:toLocal(rotationVector(quat(ang(0,E:angles():yaw() + AMovement * 10,0))/quat(E))+E:pos())
  284. E:applyTorque((Local*240-E:angVelVector()*20)*E:inertia())
  285.  
  286. if(clk("honk")){
  287. soundStop(1)
  288. }
  289. }
  290.  
Advertisement
Add Comment
Please, Sign In to add comment