Cheesecaked

weapon_rpg WIP

Jun 12th, 2021
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.04 KB | None | 0 0
  1. @name RPG
  2. @persist Prop:entity Type:string
  3. @persist GTable:gtable [RPG PRPG]:array Wielder:entity
  4. @persist
  5.  
  6. if(first()|dupefinished()){
  7. runOnTick(1)
  8. runOnLast(1)
  9.  
  10. function decide(N) {
  11. if(Wielder:weapon():type() == "weapon_rpg"){
  12. holoUnparent(0)
  13.  
  14. holoPos(0,Wielder:attachmentPos("anim_attachment_RH"))
  15. holoAng(0,Wielder:attachmentAng("anim_attachment_RH") + ang(-5,0,0))
  16.  
  17. holoParentAttachment(0,Wielder,"anim_attachment_RH")
  18.  
  19. #holoUnparent(100)
  20.  
  21. #holoParent(100,world())
  22.  
  23. Wielder:weapon():setAlpha(0)
  24. }
  25. else{
  26. if(Type == "weapon_rpg"|N == 1){
  27. holoUnparent(0)
  28.  
  29. holoPos(0,Wielder:shootPos() - Wielder:eye() * 8)
  30. holoAng(0,Wielder:attachmentAng("chest")*0.2 + ang(-90,120,0))
  31.  
  32. holoParentAttachment(0,Wielder,"chest")
  33.  
  34. #holoUnparent(100)
  35.  
  36. #holoParentAttachment(100,Wielder,"anim_attachment_RH")
  37. }
  38. }
  39.  
  40. Type = Wielder:weapon():type()
  41. }
  42.  
  43. #print(owner():attachments())
  44.  
  45. GTable = gTable("weapon_rpg",1)
  46.  
  47. entity():setAlpha(0)
  48. entity():propNotSolid(1)
  49.  
  50. timer("init",1000)
  51.  
  52. Prop = propSpawn("models/weapons/w_rocket_launcher.mdl",entity():boxCenterW() + vec(0,0,20),entity():angles():setPitch(0):setRoll(0),1)
  53. Prop:setAlpha(0)
  54.  
  55. holoCreate(0,Prop:toWorld(vec(13,-1,1)),vec(0.1),Prop:angles() + ang(0,180,0))
  56. holoAlpha(0,0)
  57.  
  58. RPG[1,entity] = holoCreate(1,holoEntity(0):toWorld(vec(0)),vec(0.2,0.1,0.6),holoEntity(0):angles(),vec(210,190,130),"hqrcube")
  59. holoMaterial(1,"models/props_wasteland/concretefloor010a")
  60. holoDisableShading(1,1)
  61. holoParent(1,0)
  62. RPG[2,entity] = holoCreate(2,RPG[1,entity]:toWorld(vec(-3,0,4.5)),vec(0.3,0.3,2),RPG[1,entity]:angles() + ang(90,0,0),vec(90),"hq_tube_thick")
  63. holoMaterial(2,"phoenix_storms/grey_chrome")
  64. holoDisableShading(2,1)
  65. holoParent(2,1)
  66. RPG[3,entity] = holoCreate(3,RPG[1,entity]:toWorld(vec(-11,0,0.4)),vec(0.2,0.1,0.5),RPG[1,entity]:angles() + ang(15,0,0),vec(210,190,130),"hqrcube")
  67. holoMaterial(3,"models/props_wasteland/concretefloor010a")
  68. holoDisableShading(3,1)
  69. holoParent(3,2)
  70. RPG[4,entity] = holoCreate(4,RPG[1,entity]:toWorld(vec(-22.2,0,4.5)),vec(0.3,0.3,1.2),RPG[1,entity]:angles() + ang(90,0,0),vec(210,190,130),"hq_tube_thick")
  71. holoMaterial(4,"models/props_wasteland/concretefloor010a")
  72. holoParent(4,2)
  73. RPG[5,entity] = holoCreate(5,RPG[1,entity]:toWorld(vec(-41,0,4.5)),vec(0.3,0.3,2),RPG[1,entity]:angles() + ang(-90,0,0),vec(210,190,130),"hq_cone")
  74. holoMaterial(5,"models/props_wasteland/concretefloor010a")
  75. holoClip(5,1,vec(0,0,-4.5),vec(0,0,-1),0)
  76. holoClip(5,2,vec(0,0,-11.8),vec(0,0,1),0)
  77. holoClipEnabled(5,1,1)
  78. holoClipEnabled(5,2,1)
  79. holoParent(5,4)
  80. RPG[6,entity] = holoCreate(6,RPG[1,entity]:toWorld(vec(-35.4,0,4.5)),vec(0.21,0.21,1),RPG[1,entity]:angles() + ang(90,0,0),vec(210,190,130),"hq_tube_thick")
  81. holoMaterial(6,"models/props_wasteland/concretefloor010a")
  82. holoParent(6,4)
  83. RPG[7,entity] = holoCreate(7,RPG[1,entity]:toWorld(vec(-40.8,0,4.5)),vec(0.4,0.4,1.88),RPG[1,entity]:angles() + ang(90,0,0),vec(80),"hq_cone")
  84. holoMaterial(7,"phoenix_storms/grey_chrome")
  85. holoDisableShading(7,1)
  86. holoClip(7,1,vec(0,0,0),vec(0,0,-1),0)
  87. holoClip(7,2,vec(0,0,-11.2),vec(0,0,1),0)
  88. holoClipEnabled(7,1,1)
  89. holoClipEnabled(7,2,1)
  90. holoParent(7,4)
  91. RPG[8,entity] = holoCreate(8,RPG[1,entity]:toWorld(vec(-44.3,0,4.5)),-vec(0.34,0.34,1.27),RPG[1,entity]:angles() + ang(-90,0,0),vec(70),"hq_cone")
  92. holoMaterial(8,"phoenix_storms/grey_chrome")
  93. holoDisableShading(8,1)
  94. holoClip(8,1,vec(0,0,-2.91),vec(0,0,1),0)
  95. holoClip(8,2,vec(0,0,7.5),vec(0,0,-1),0)
  96. holoClipEnabled(8,1,1)
  97. holoClipEnabled(8,2,1)
  98. holoParent(8,7)
  99. RPG[9,entity] = holoCreate(9,RPG[1,entity]:toWorld(vec(-52,0,4.5)),vec(0.35,0.35,0.1),RPG[1,entity]:angles() + ang(90,0,0),vec(80),"hqtorus")
  100. holoMaterial(9,"phoenix_storms/grey_chrome")
  101. holoDisableShading(9,1)
  102. holoParent(9,7)
  103. RPG[10,entity] = holoCreate(10,RPG[1,entity]:toWorld(vec(-11,0,6.5)),vec(0.4,0.15,0.05),RPG[1,entity]:angles(),vec(50),"hqrcube")
  104. holoDisableShading(10,1)
  105. holoParent(10,2)
  106. RPG[11,entity] = holoCreate(11,RPG[10,entity]:toWorld(vec(-0.7,0.6,0.9)),vec(0.2,0.02,0.1),RPG[10,entity]:angles(),vec(50),"hq_cube")
  107. holoDisableShading(11,1)
  108. holoParent(11,10)
  109. RPG[12,entity] = holoCreate(12,RPG[10,entity]:toWorld(vec(-0.7,-0.6,0.9)),vec(0.2,0.02,0.1),RPG[10,entity]:angles(),vec(50),"hq_cube")
  110. holoDisableShading(12,1)
  111. holoParent(12,10)
  112. RPG[13,entity] = holoCreate(13,RPG[10,entity]:toWorld(vec(-0.7,0,2.4)),vec(0.2,0.2,0.25),RPG[10,entity]:angles() + ang(90,0,0),vec(50),"hq_tube")
  113. holoDisableShading(13,1)
  114. holoParent(13,10)
  115. RPG[14,entity] = holoCreate(14,RPG[10,entity]:toWorld(vec(-0.7,0,2.4)),vec(0.15,0.15,0.4),RPG[10,entity]:angles() + ang(90,0,0),vec(40),"hq_tube")
  116. holoDisableShading(14,1)
  117. holoParent(14,10)
  118. RPG[15,entity] = holoCreate(15,RPG[10,entity]:toWorld(vec(-3,0,2.4)),vec(0.11,0.11,0.03),RPG[10,entity]:angles() + ang(90,0,0),vec(255),"hqrcylinder")
  119. holoAlpha(15,4)
  120. holoParent(15,14)
  121. RPG[16,entity] = holoCreate(16,RPG[10,entity]:toWorld(vec(-3,0,2.4)),vec(0.01,0.01,0.005),RPG[10,entity]:angles() + ang(90,0,0),vec(255,0,0),"hq_cylinder")
  122. holoParent(16,15)
  123. RPG[17,entity] = holoCreate(17,RPG[10,entity]:toWorld(vec(1,0,2.4)),vec(0.11,0.11,0.03),RPG[10,entity]:angles() + ang(90,0,0),vec(255),"hqrcylinder")
  124. holoAlpha(17,4)
  125. holoParent(17,14)
  126. RPG[18,entity] = holoCreate(18,RPG[1,entity]:toWorld(vec(1,0,2.5)),vec(0.5,0.15,0.1),RPG[1,entity]:angles(),vec(90),"hq_cube")
  127. holoParent(18,1)
  128. RPG[19,entity] = holoCreate(19,RPG[1,entity]:toWorld(vec(0,0,1.5)),vec(0.25,0.15,0.2),RPG[1,entity]:angles(),vec(90),"hq_cube")
  129. holoParent(19,1)
  130. RPG[20,entity] = holoCreate(20,RPG[1,entity]:toWorld(vec(2,0,1.3)),vec(0.15,0.3,0.15),RPG[1,entity]:angles() + ang(90,90,0),vec(90),"hqstube2")
  131. holoParent(20,1)
  132. RPG[21,entity] = holoCreate(21,RPG[1,entity]:toWorld(vec(2.7,0,1.2)),vec(0.25,0.3,0.1),RPG[1,entity]:angles() + ang(90,90,0),vec(90),"hq_tube_thick")
  133. holoClip(21,1,vec(0.6,0,0),vec(-1,0,0),0)
  134. holoClip(21,2,vec(0,0.3,0),vec(0,1,0),0)
  135. holoClipEnabled(21,1,1)
  136. holoClipEnabled(21,2,1)
  137. holoParent(21,1)
  138.  
  139. holoCreate(100,holoEntity(0):pos(),holoScale(0),holoEntity(0):angles(),vec(255))
  140.  
  141. PRPG[1,entity] = holoCreate(101,RPG[1,entity]:pos(),holoScale(1),RPG[1,entity]:angles(),RPG[1,entity]:getColor(),"hqrcube")
  142. holoMaterial(101,"models/props_wasteland/concretefloor010a")
  143. holoDisableShading(101,1)
  144. holoParent(101,100)
  145. PRPG[2,entity] = holoCreate(102,RPG[2,entity]:pos(),holoScale(2),RPG[2,entity]:angles(),RPG[2,entity]:getColor(),"hq_tube_thick")
  146. holoMaterial(102,"phoenix_storms/grey_chrome")
  147. holoDisableShading(102,1)
  148. holoParent(102,101)
  149. PRPG[3,entity] = holoCreate(103,RPG[3,entity]:pos(),holoScale(3),RPG[3,entity]:angles(),RPG[3,entity]:getColor(),"hqrcube")
  150. holoMaterial(103,"models/props_wasteland/concretefloor010a")
  151. holoDisableShading(103,1)
  152. holoParent(103,102)
  153. PRPG[4,entity] = holoCreate(104,RPG[4,entity]:pos(),holoScale(4),RPG[4,entity]:angles(),RPG[4,entity]:getColor(),"hq_tube_thick")
  154. holoMaterial(104,"models/props_wasteland/concretefloor010a")
  155. holoParent(104,102)
  156. PRPG[5,entity] = holoCreate(105,RPG[5,entity]:pos(),holoScale(5),RPG[5,entity]:angles(),RPG[5,entity]:getColor(),"hq_cone")
  157. holoMaterial(105,"models/props_wasteland/concretefloor010a")
  158. holoClip(105,1,vec(0,0,-4.5),vec(0,0,-1),0)
  159. holoClip(105,2,vec(0,0,-11.8),vec(0,0,1),0)
  160. holoClipEnabled(105,1,1)
  161. holoClipEnabled(105,2,1)
  162. holoParent(105,104)
  163. PRPG[6,entity] = holoCreate(106,RPG[6,entity]:pos(),holoScale(6),RPG[6,entity]:angles(),RPG[6,entity]:getColor(),"hq_tube_thick")
  164. holoMaterial(106,"models/props_wasteland/concretefloor010a")
  165. holoParent(106,104)
  166. PRPG[7,entity] = holoCreate(107,RPG[7,entity]:pos(),holoScale(7),RPG[7,entity]:angles(),RPG[7,entity]:getColor(),"hq_cone")
  167. holoMaterial(107,"phoenix_storms/grey_chrome")
  168. holoDisableShading(107,1)
  169. holoClip(107,1,vec(0,0,0),vec(0,0,-1),0)
  170. holoClip(107,2,vec(0,0,-11.2),vec(0,0,1),0)
  171. holoClipEnabled(107,1,1)
  172. holoClipEnabled(107,2,1)
  173. holoParent(107,104)
  174. PRPG[8,entity] = holoCreate(108,RPG[8,entity]:pos(),holoScale(8),RPG[8,entity]:angles(),RPG[8,entity]:getColor(),"hq_cone")
  175. holoMaterial(108,"phoenix_storms/grey_chrome")
  176. holoDisableShading(108,1)
  177. holoClip(108,1,vec(0,0,-2.91),vec(0,0,1),0)
  178. holoClip(108,2,vec(0,0,7.5),vec(0,0,-1),0)
  179. holoClipEnabled(108,1,1)
  180. holoClipEnabled(108,2,1)
  181. holoParent(108,107)
  182. PRPG[9,entity] = holoCreate(109,RPG[9,entity]:pos(),holoScale(9),RPG[9,entity]:angles(),RPG[9,entity]:getColor(),"hqtorus")
  183. holoMaterial(109,"phoenix_storms/grey_chrome")
  184. holoDisableShading(109,1)
  185. holoParent(109,107)
  186. PRPG[10,entity] = holoCreate(110,RPG[10,entity]:pos(),holoScale(10),RPG[10,entity]:angles(),RPG[10,entity]:getColor(),"hqrcube")
  187. holoDisableShading(110,1)
  188. holoParent(110,102)
  189. PRPG[11,entity] = holoCreate(111,RPG[11,entity]:pos(),holoScale(11),RPG[11,entity]:angles(),RPG[11,entity]:getColor(),"hq_cube")
  190. holoDisableShading(111,1)
  191. holoParent(111,110)
  192. PRPG[12,entity] = holoCreate(112,RPG[12,entity]:pos(),holoScale(12),RPG[12,entity]:angles(),RPG[12,entity]:getColor(),"hq_cube")
  193. holoDisableShading(112,1)
  194. holoParent(112,110)
  195. PRPG[13,entity] = holoCreate(113,RPG[13,entity]:pos(),holoScale(13),RPG[13,entity]:angles(),RPG[13,entity]:getColor(),"hq_tube")
  196. holoDisableShading(113,1)
  197. holoParent(113,110)
  198. PRPG[14,entity] = holoCreate(114,RPG[14,entity]:pos(),holoScale(14),RPG[14,entity]:angles(),RPG[14,entity]:getColor(),"hq_tube")
  199. holoDisableShading(114,1)
  200. holoParent(114,110)
  201. PRPG[15,entity] = holoCreate(115,RPG[15,entity]:pos(),holoScale(15),RPG[15,entity]:angles(),RPG[15,entity]:getColor(),"hqrcylinder")
  202. holoAlpha(115,4)
  203. holoParent(115,114)
  204. PRPG[16,entity] = holoCreate(116,RPG[16,entity]:pos(),holoScale(16),RPG[16,entity]:angles(),RPG[16,entity]:getColor(),"hq_cylinder")
  205. holoParent(116,115)
  206. PRPG[17,entity] = holoCreate(117,RPG[17,entity]:pos(),holoScale(17),RPG[17,entity]:angles(),RPG[17,entity]:getColor(),"hqrcylinder")
  207. holoAlpha(117,4)
  208. holoParent(117,114)
  209. PRPG[18,entity] = holoCreate(118,RPG[18,entity]:pos(),holoScale(18),RPG[18,entity]:angles(),RPG[18,entity]:getColor(),"hq_cube")
  210. holoParent(118,101)
  211. PRPG[19,entity] = holoCreate(119,RPG[19,entity]:pos(),holoScale(19),RPG[19,entity]:angles(),RPG[19,entity]:getColor(),"hq_cube")
  212. holoParent(119,101)
  213. PRPG[20,entity] = holoCreate(120,RPG[20,entity]:pos(),holoScale(20),RPG[20,entity]:angles(),RPG[20,entity]:getColor(),"hqstube2")
  214. holoParent(120,101)
  215. PRPG[21,entity] = holoCreate(121,RPG[21,entity]:pos(),holoScale(21),RPG[21,entity]:angles(),RPG[21,entity]:getColor(),"hq_tube_thick")
  216. holoClip(121,1,vec(0.6,0,0),vec(-1,0,0),0)
  217. holoClip(121,2,vec(0,0.3,0),vec(0,1,0),0)
  218. holoClipEnabled(121,1,1)
  219. holoClipEnabled(121,2,1)
  220. holoParent(121,101)
  221.  
  222. for(P = 1,players():count()){
  223. for(H = 101,121){
  224. holoVisible(H,players()[P,entity],0)
  225. }
  226. }
  227.  
  228. #holoPos(0,owner():attachmentPos("anim_attachment_RH"))
  229. #holoAng(0,owner():attachmentAng("anim_attachment_RH"))
  230.  
  231. #holoParentAttachment(0,owner(),"anim_attachment_RH")
  232. }
  233. else{
  234. if(clk("init")){
  235. #Prop:propFreeze(0)
  236. }
  237.  
  238. if(Wielder:isValid() == 0){
  239. for(P = 1,players():count()){
  240. if(players()[P,entity]:aimEntity() == Prop){
  241. if(changed(players()[P,entity]:keyUse())){
  242. if(players()[P,entity]:keyUse()){
  243. if(GTable[players()[P,entity]:steamID64()+",own",number] == 0){
  244. GTable[players()[P,entity]:steamID64()+",own",number] = 1
  245. GTable[players()[P,entity]:steamID64()+",ammo",number] = 16
  246. Wielder = players()[P,entity]
  247.  
  248. decide(1)
  249.  
  250. RPG[1,entity]:soundPlay(1,2,"BaseCombatCharacter.AmmoPickup")
  251.  
  252. for(H = 1,21){
  253. holoVisible(H,Wielder,0)
  254. }
  255. for(H = 101,121){
  256. holoVisible(H,Wielder,1)
  257. }
  258.  
  259. Prop:propDelete()
  260. }
  261. else{
  262. RPG[1,entity]:soundPlay(1,2,"Buttons.snd2")
  263. }
  264. }
  265. }
  266. }
  267. }
  268. }
  269. else{
  270. if(Wielder:weapon():type() == "weapon_rpg"){
  271. holoAng(100,Wielder:eyeAngles())
  272. if(Wielder:keyAttack2()){
  273. holoPos(100,owner():shootPos() + owner():eye() * 20 - vec(0,0,9))
  274. holoAng(100,(Wielder:aimPos() - owner():shootPos()):toAngle())
  275. }
  276. else{
  277. holoPos(100,owner():shootPos() + owner():eye() * 10 + owner():right() * 6 - vec(0,0,6))
  278. holoAng(100,Wielder:eyeAngles())
  279. }
  280. }
  281. else{
  282.  
  283. }
  284. }
  285.  
  286. if(changed(owner():weapon())){
  287. decide(0)
  288. }
  289. #holoPos(0,owner():attachmentPos("anim_attachment_RH"))
  290. #holoAng(0,owner():attachmentAng("anim_attachment_RH"))
  291. }
  292.  
  293. if(last()){
  294. GTable[Wielder:steamID64() + ",own",number] = 0
  295. }
  296.  
  297. #Cheesecake propSpawn()
  298.  
Advertisement
Add Comment
Please, Sign In to add comment