welel33t

dual pistols

Oct 1st, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.18 KB | None | 0 0
  1. --[[Dual pistols Frostftw]]
  2. --
  3. wait();
  4. Services = setmetatable({},{__index = function(t,i)
  5. return game:service(i) or nil
  6. end})
  7. plr = Services.Players.LocalPlayer
  8. char = plr.Character
  9. Humans = char:findFirstChild("Humanoid")
  10. BulletTable,Disposables,Lasers = {},{},{}
  11. Clips,Bullets,CurrentGun = 2500,20,1
  12. GunShot = {
  13. Sound = "rbxassetid://132373574",
  14. Pitch = 1,
  15. Volume = 1,
  16. }
  17. Reloading,FlashLight,LaserLight,Silenced,LockHead,Deselectd,ToolName,LaserColor = false,false,false,false,false,false,"Dual Pistols","Bright red"
  18. V3,BC,CF = Vector3.new,BrickColor.new,CFrame
  19. for i,v in pairs(plr.Character:GetChildren()) do
  20. if v:IsA("Model") and v.Name == "MainModel" then
  21. v:Remove()
  22. end
  23. end
  24. for i,v in pairs(plr.Backpack:GetChildren()) do
  25. if v.Name == ToolName then
  26. v:Remove()
  27. end
  28. end
  29. Bin = Instance.new("HopperBin",plr.Backpack)
  30. Bin.Name = ToolName
  31. MainModel,GunModelOne,GunModelTwo,SheathOne,SheathTwo,Eff = Instance.new("Model"),Instance.new("Model"),Instance.new("Model"),Instance.new("Model"),Instance.new("Model"),Instance.new("Model")
  32. MainModel.Name,GunModelOne.Name,GunModelTwo.Name,SheathOne.Name,SheathTwo.Name,Eff.Name = "MainModel","GunModelOne","GunModelTwo","SheathOne","SheathTwo","Eff"
  33. MainModel.Parent,GunModelOne.Parent,GunModelTwo.Parent,SheathOne.Parent,SheathTwo.Parent,Eff.Parent = char,MainModel,MainModel,MainModel,MainModel,MainModel
  34. L1,L2,L3,L4 = Instance.new("SpotLight"), Instance.new("SpotLight"), Instance.new("SpotLight"), Instance.new("SpotLight")
  35. L1.Enabled,L2.Enabled,L3.Enabled,L4.Enabled = false,false,false,false
  36. L1.Brightness,L2.Brightness,L3.Brightness,L4.Brightness = 60,60,40,40
  37. L1.Range,L2.Range,L3.Range,L4.Range = 25,25,40,40
  38. L1.Color,L2.Color,L3.Color,L4.Color = BrickColor.new("Neon orange").Color,BrickColor.new("Neon orange").Color,BrickColor.new("Bright red").Color,BrickColor.new("Bright red").Color
  39. L3.Name,L4.Name = "Safe","Safe"
  40. script.Parent = MainModel
  41. function AddPart(name,parent,s1,s2,s3,color)
  42. p=Instance.new("Part",parent)
  43. p.Name=name
  44. p.formFactor="Custom"
  45. p.Anchored=false
  46. p.Locked=true
  47. p.CanCollide=false
  48. p.Size=Vector3.new(s1,s2,s3)
  49. p.TopSurface = "Smooth"
  50. p.BottomSurface = "Smooth"
  51. p.BrickColor=BrickColor.new(color)
  52. Instance.new("BlockMesh",p).Name = "Mesh"
  53. p:BreakJoints()
  54. return p
  55. end
  56. function AddWeld(name,parent,p1,p0,c1,c0)
  57. we=Instance.new("Weld",parent)
  58. we.Part1=p1
  59. we.Part0=p0
  60. we.C1=c0
  61. we.C0=c1
  62. return we
  63. end
  64. --Gets a bit confusing down below :3
  65. HandleOne,HandleTwo = AddPart("HandleLeft",GunModelOne,.02,1,.4,"Really black"),AddPart("HandleLeft",GunModelTwo,.02,1,.4,"Really black")
  66. HandleWeldLeft,HandleWeldRight = AddWeld("Weld",HandleOne,HandleOne,char["Torso"],CF.new(-1,0,-1),CF.Angles(math.rad(45),math.rad(180),0)),AddWeld("Weld",HandleTwo,HandleTwo,char["Torso"],CF.new(1,0,-1),CF.Angles(math.rad(45),math.rad(180),0))
  67. HandLeft = AddPart("HandLeft",MainModel,1,1,1,"Really black")
  68. HandRight = AddPart("HandRight",MainModel,1,1,1,"Really black")
  69. HandLeft.Transparency,HandRight.Transparency = 1,1
  70. AddWeld("Weld",HandLeft,HandLeft,char["Left Arm"],CF.new(0,-1,0),CF.Angles(math.rad(90),0,0))
  71. AddWeld("Weld",HandRight,HandRight,char["Right Arm"],CF.new(0,-1,0),CF.Angles(math.rad(90),0,0))
  72. PA1 = AddPart("Part",GunModelOne,.3,.1,1,"Really black")
  73. PA1.Mesh.Scale = V3(1,.6,1)
  74. WPA1 = AddWeld("Weld",PA1,PA1,HandleOne,CF.new(0,0.5,-.3),CF.new(0,0,0))
  75. PA2 = AddPart("Part",GunModelOne,.1,.5,.1,"Bright red")
  76. PA2.Mesh:Remove()
  77. Instance.new("CylinderMesh",PA2).Scale = V3(.5,1,.5)
  78. WPA2 = AddWeld("Weld",PA2,PA2,HandleOne,CF.new(0,.6,-.9),CF.Angles(math.rad(90),0,0))
  79. PA3 = AddPart("Part",GunModelOne,.1,1.3,.1,"Bright red")
  80. PA3.Mesh:Remove()
  81. Instance.new("CylinderMesh",PA3).Scale = V3(.7,1,.8)
  82. WPA3 = AddWeld("Weld",PA3,PA3,HandleOne,CF.new(0,.75,-.6),CF.Angles(math.rad(90),0,0))
  83. PA4 = AddPart("Part",GunModelOne,.3,.1,1.2,"Really black")
  84. PA4.Mesh.Scale = V3(1,1,1)
  85. WPA4 = AddWeld("Weld",PA4,PA4,HandleOne,CF.new(0,.65,-.5),CF.new(0,0,0))
  86. PA5 = AddPart("Part",GunModelOne,.3,.1,.3,"Really black")
  87. PA5.Mesh:Remove()
  88. Instance.new("CylinderMesh",PA5).Scale = V3(1,1,1)
  89. WPA5 = AddWeld("Weld",PA5,PA5,PA4,CF.new(0,0.1,-0.5),CF.Angles(math.rad(90),0,0))
  90. PA6 = AddPart("Part",GunModelOne,.3,.5,.3,"Really black")
  91. PA6.Mesh:Remove()
  92. Instance.new("CylinderMesh",PA6).Scale = V3(1,1,1)
  93. WPA6 = AddWeld("Weld",PA6,PA6,PA4,CF.new(0,0.1,0.35),CF.Angles(math.rad(90),0,0))
  94. PA7 = AddPart("Part",GunModelOne,.1,.1,.5,"Really black")
  95. PA7.Mesh:Remove()
  96. Instance.new("CylinderMesh",PA7).Scale = V3(.9,.9,1)
  97. WPA7 = AddWeld("Weld",PA7,PA7,PA3,CF.new(0,-0.31,0),CF.Angles(0,0,0))
  98. BamOne = Instance.new("Sound",PA7)
  99. BamOne.Pitch,BamOne.Volume,BamOne.SoundId = GunShot.Pitch,GunShot.Volume,GunShot.Sound
  100. PA8 = AddPart("Part",GunModelOne,.3,.1,.25,"Really black")
  101. PA8.Mesh:Remove()
  102. sm = Instance.new("SpecialMesh",PA8)
  103. sm.MeshType = "Wedge"
  104. sm.Scale = V3(.38,.6,1)
  105. WPA8 = AddWeld("Weld",PA8,PA8,PA6,CF.new(0.1,-.3,-0.07),CF.Angles(math.rad(180),0,0))
  106. PA9 = AddPart("Part",GunModelOne,.3,.1,.25,"Really black")
  107. PA9.Mesh:Remove()
  108. sm = Instance.new("SpecialMesh",PA9)
  109. sm.MeshType = "Wedge"
  110. sm.Scale = V3(.35,.6,1)
  111. WPA9 = AddWeld("Weld",PA9,PA9,PA6,CF.new(-0.1,-.3,-0.07),CF.Angles(math.rad(180),0,0))
  112. PA10 = AddPart("Part",GunModelOne,.3,.1,.25,"Really black")
  113. PA10.Mesh:Remove()
  114. sm = Instance.new("SpecialMesh",PA10)
  115. sm.MeshType = "Wedge"
  116. sm.Scale = V3(.35,.6,1)
  117. WPA10 = AddWeld("Weld",PA10,PA10,PA6,CF.new(0,-.34,0),CF.Angles(math.rad(100),0,0))
  118. PA11 = AddPart("Part",GunModelOne,.1,.3,.1,"Really black")
  119. PA11.Mesh:Remove()
  120. sm = Instance.new("SpecialMesh",PA11)
  121. sm.MeshType = "Wedge"
  122. sm.Scale = V3(.5,1,.5)
  123. WPA11 = AddWeld("Weld",PA11,PA11,HandleOne,CF.new(0,.25,-.35),CF.Angles(math.rad(90),0,0))
  124. PA12 = AddPart("Part",GunModelOne,.1,.1,.3,"Really black")
  125. PA12.Mesh:Remove()
  126. sm = Instance.new("SpecialMesh",PA12)
  127. sm.MeshType = "Wedge"
  128. sm.Scale = V3(.5,.5,.5)
  129. WPA12 = AddWeld("Weld",PA12,PA12,HandleOne,CF.new(0,.37,-.55),CF.Angles(math.rad(90),0,0))
  130. PA13 = AddPart("Part",GunModelOne,.1,.1,.3,"Really black")
  131. PA13.Mesh:Remove()
  132. sm = Instance.new("SpecialMesh",PA13)
  133. sm.MeshType = "Wedge"
  134. sm.Scale = V3(.5,.5,.5)
  135. WPA13 = AddWeld("Weld",PA13,PA13,HandleOne,CF.new(0,.37,-.45),CF.Angles(math.rad(270),0,0))
  136. PA14 = AddPart("Part",GunModelOne,.1,.1,.3,"Really black")
  137. PA14.Mesh:Remove()
  138. sm = Instance.new("SpecialMesh",PA14)
  139. sm.MeshType = "Wedge"
  140. sm.Scale = V3(.5,.5,.5)
  141. WPA14 = AddWeld("Weld",PA14,PA14,HandleOne,CF.new(0,.4,-.3),CF.Angles(math.rad(55),0,0))
  142. PA15 = AddPart("Part",GunModelOne,.1,.3,.3,"Really black")
  143. PA15.Mesh:Remove()
  144. sm = Instance.new("SpecialMesh",PA15)
  145. sm.MeshType = "Wedge"
  146. sm.Scale = V3(1,1,.25)
  147. WPA15 = AddWeld("Weld",PA15,PA15,HandleOne,CF.new(0,-0.35,-.23),CF.Angles(math.rad(0),0,0))
  148. PA16 = AddPart("Part",GunModelOne,.02,1,.3,"Bright red")
  149. PA16.Mesh.Scale = V3(1.1,.9,1)
  150. WPA16 = AddWeld("Weld",PA16,PA16,HandleOne,CF.new(0,0,0),CF.new(0,0,0))
  151. PA17 = AddPart("Part",GunModelOne,.1,.3,.3,"Bright red")
  152. PA17.Mesh:Remove()
  153. sm = Instance.new("SpecialMesh",PA17)
  154. sm.MeshType = "Wedge"
  155. sm.Scale = V3(1.1,1,.25)
  156. WPA17 = AddWeld("Weld",PA17,PA17,PA15,CF.new(0,0.05,0.05),CF.Angles(math.rad(0),0,0))
  157. PA18 = AddPart("Part",GunModelOne,.1,.3,.1,"Bright red")
  158. PA18.Mesh:Remove()
  159. Instance.new("CylinderMesh",PA18).Scale = V3(.5,.8,.5)
  160. WPA18 = AddWeld("Weld",PA18,PA18,HandleOne,CF.new(0,0.2,0),CF.Angles(math.rad(90),math.rad(90),0))
  161. PA19 = AddPart("Part",GunModelOne,.1,.3,.1,"Really black")
  162. PA19.Mesh:Remove()
  163. Instance.new("CylinderMesh",PA19).Scale = V3(.5,1,.5)
  164. WPA19 = AddWeld("Weld",PA19,PA19,PA3,CF.new(0,0.51,0),CF.Angles(math.rad(0),math.rad(0),0))
  165. PA20 = AddPart("Part",GunModelOne,.1,.3,.1,"Really black")
  166. PA20.Mesh:Remove()
  167. PA20.Transparency = 1
  168. L2.Parent = PA20
  169. L3.Parent = PA20
  170. WPA20 = AddWeld("Weld",PA20,PA20,PA3,CF.new(0,0.6,0),CF.Angles(math.rad(261),0,0))
  171. PA21 = AddPart("Part",GunModelOne,.1,.25,.1,"Really black")
  172. WPA21 = AddWeld("Weld",PA21,PA21,PA3,CF.new(0,0.1,-0.35),CF.Angles(math.rad(0),0,0))
  173. PA22 = AddPart("Part",GunModelOne,.1,.35,.3,"Really black")
  174. WPA22 = AddWeld("Weld",PA21,PA21,PA22,CF.new(0,0,0.2),CF.Angles(math.rad(0),0,0))
  175. PA23 = AddPart("Part",GunModelOne,.1,.35,.1,"Gold")
  176. PA23.Mesh:Remove()
  177. PA23.Transparency = 0.4
  178. Instance.new("CylinderMesh",PA23).Scale = Vector3.new(0.5,1,0.5)
  179. WPA23 = AddWeld("Weld",PA22,PA22,PA23,CF.new(0,-0.03,0.05),CF.Angles(math.rad(0),0,0))
  180. PA24 = AddPart("Part",GunModelOne,.1,.35,.1,"Really black")
  181. PA24.Mesh:Remove()
  182. PA24.Transparency = 1
  183. Instance.new("CylinderMesh",PA24).Scale = Vector3.new(0.5,1,0.5)
  184. WPA24 = AddWeld("Weld",PA22,PA22,PA24,CF.new(0,-0.03,-0.06),CF.Angles(math.rad(90),0,0))
  185. PA26 = AddPart("Part",GunModelOne,.1,.35,.1,LaserColor)
  186. PA26.Mesh:Remove()
  187. PA26.Transparency = 0.4
  188. Instance.new("CylinderMesh",PA26).Scale = Vector3.new(0.5,1,0.5)
  189. WPA26 = AddWeld("Weld",PA22,PA22,PA26,CF.new(0,-0.03,-0.06),CF.Angles(math.rad(0),0,0))
  190. --Gun 2 Below
  191. PB1 = AddPart("Part",GunModelTwo,.3,.1,1,"Really black")
  192. PB1.Mesh.Scale = V3(1,.6,1)
  193. WPB1 = AddWeld("Weld",PB1,PB1,HandleTwo,CF.new(0,0.5,-.3),CF.new(0,0,0))
  194. PB2 = AddPart("Part",GunModelTwo,.1,.5,.1,"Bright red")
  195. PB2.Mesh:Remove()
  196. Instance.new("CylinderMesh",PB2).Scale = V3(.5,1,.5)
  197. WPB2 = AddWeld("Weld",PB2,PB2,HandleTwo,CF.new(0,.6,-.9),CF.Angles(math.rad(90),0,0))
  198. PB3 = AddPart("Part",GunModelTwo,.1,1.3,.1,"Bright red")
  199. PB3.Mesh:Remove()
  200. Instance.new("CylinderMesh",PB3).Scale = V3(.7,1,.8)
  201. WPB3 = AddWeld("Weld",PB3,PB3,HandleTwo,CF.new(0,.75,-.6),CF.Angles(math.rad(90),0,0))
  202. PB4 = AddPart("Part",GunModelTwo,.3,.1,1.2,"Really black")
  203. PB4.Mesh.Scale = V3(1,1,1)
  204. WPB4 = AddWeld("Weld",PB4,PB4,HandleTwo,CF.new(0,.65,-.5),CF.new(0,0,0))
  205. PB5 = AddPart("Part",GunModelTwo,.3,.1,.3,"Really black")
  206. PB5.Mesh:Remove()
  207. Instance.new("CylinderMesh",PB5).Scale = V3(1,1,1)
  208. WPB5 = AddWeld("Weld",PB5,PB5,PB4,CF.new(0,0.1,-0.5),CF.Angles(math.rad(90),0,0))
  209. PB6 = AddPart("Part",GunModelTwo,.3,.5,.3,"Really black")
  210. PB6.Mesh:Remove()
  211. Instance.new("CylinderMesh",PB6).Scale = V3(1,1,1)
  212. WPB6 = AddWeld("Weld",PB6,PB6,PB4,CF.new(0,0.1,0.35),CF.Angles(math.rad(90),0,0))
  213. PB7 = AddPart("Part",GunModelTwo,.1,.1,.5,"Really black")
  214. PB7.Mesh:Remove()
  215. Instance.new("CylinderMesh",PB7).Scale = V3(.9,.9,1)
  216. WPB7 = AddWeld("Weld",PB7,PB7,PB3,CF.new(0,-0.31,0),CF.Angles(0,0,0))
  217. BamTwo = Instance.new("Sound",PB7)
  218. BamTwo.Pitch,BamTwo.Volume,BamTwo.SoundId = GunShot.Pitch,GunShot.Volume,GunShot.Sound
  219. PB8 = AddPart("Part",GunModelTwo,.3,.1,.25,"Really black")
  220. PB8.Mesh:Remove()
  221. sm = Instance.new("SpecialMesh",PB8)
  222. sm.MeshType = "Wedge"
  223. sm.Scale = V3(.38,.6,1)
  224. WPB8 = AddWeld("Weld",PB8,PB8,PB6,CF.new(0.1,-.3,-0.07),CF.Angles(math.rad(180),0,0))
  225. PB9 = AddPart("Part",GunModelOne,.3,.1,.25,"Really black")
  226. PB9.Mesh:Remove()
  227. sm = Instance.new("SpecialMesh",PB9)
  228. sm.MeshType = "Wedge"
  229. sm.Scale = V3(.35,.6,1)
  230. WPB9 = AddWeld("Weld",PB9,PB9,PB6,CF.new(-0.1,-.3,-0.07),CF.Angles(math.rad(180),0,0))
  231. PB10 = AddPart("Part",GunModelTwo,.3,.1,.25,"Really black")
  232. PB10.Mesh:Remove()
  233. sm = Instance.new("SpecialMesh",PB10)
  234. sm.MeshType = "Wedge"
  235. sm.Scale = V3(.35,.6,1)
  236. WPB10 = AddWeld("Weld",PB10,PB10,PB6,CF.new(0,-.34,0),CF.Angles(math.rad(100),0,0))
  237. PB11 = AddPart("Part",GunModelTwo,.1,.3,.1,"Really black")
  238. PB11.Mesh:Remove()
  239. sm = Instance.new("SpecialMesh",PB11)
  240. sm.MeshType = "Wedge"
  241. sm.Scale = V3(.5,1,.5)
  242. WPB11 = AddWeld("Weld",PB11,PB11,HandleTwo,CF.new(0,.25,-.35),CF.Angles(math.rad(90),0,0))
  243. PB12 = AddPart("Part",GunModelTwo,.1,.1,.3,"Really black")
  244. PB12.Mesh:Remove()
  245. sm = Instance.new("SpecialMesh",PB12)
  246. sm.MeshType = "Wedge"
  247. sm.Scale = V3(.5,.5,.5)
  248. WPB12 = AddWeld("Weld",PB12,PB12,HandleTwo,CF.new(0,.37,-.55),CF.Angles(math.rad(90),0,0))
  249. PB13 = AddPart("Part",GunModelTwo,.1,.1,.3,"Really black")
  250. PB13.Mesh:Remove()
  251. sm = Instance.new("SpecialMesh",PB13)
  252. sm.MeshType = "Wedge"
  253. sm.Scale = V3(.5,.5,.5)
  254. WPB13 = AddWeld("Weld",PB13,PB13,HandleTwo,CF.new(0,.37,-.45),CF.Angles(math.rad(270),0,0))
  255. PB14 = AddPart("Part",GunModelTwo,.1,.1,.3,"Really black")
  256. PB14.Mesh:Remove()
  257. sm = Instance.new("SpecialMesh",PB14)
  258. sm.MeshType = "Wedge"
  259. sm.Scale = V3(.5,.5,.5)
  260. WPB14 = AddWeld("Weld",PB14,PB14,HandleTwo,CF.new(0,.4,-.3),CF.Angles(math.rad(55),0,0))
  261. PB15 = AddPart("Part",GunModelTwo,.1,.3,.3,"Really black")
  262. PB15.Mesh:Remove()
  263. sm = Instance.new("SpecialMesh",PB15)
  264. sm.MeshType = "Wedge"
  265. sm.Scale = V3(1,1,.25)
  266. WPB15 = AddWeld("Weld",PB15,PB15,HandleTwo,CF.new(0,-0.35,-.23),CF.Angles(math.rad(0),0,0))
  267. PB16 = AddPart("Part",GunModelTwo,.02,1,.3,"Bright red")
  268. PB16.Mesh.Scale = V3(1.1,.9,1)
  269. WPB16 = AddWeld("Weld",PB16,PB16,HandleTwo,CF.new(0,0,0),CF.new(0,0,0))
  270. PB17 = AddPart("Part",GunModelTwo,.1,.3,.3,"Bright red")
  271. PB17.Mesh:Remove()
  272. sm = Instance.new("SpecialMesh",PB17)
  273. sm.MeshType = "Wedge"
  274. sm.Scale = V3(1.1,1,.25)
  275. WPB17 = AddWeld("Weld",PB17,PB17,PB15,CF.new(0,0.05,0.05),CF.Angles(math.rad(0),0,0))
  276. PB18 = AddPart("Part",GunModelTwo,.1,.3,.1,"Bright red")
  277. PB18.Mesh:Remove()
  278. Instance.new("CylinderMesh",PB18).Scale = V3(.5,.8,.5)
  279. WPB18 = AddWeld("Weld",PB18,PB18,HandleTwo,CF.new(0,0.2,0),CF.Angles(math.rad(90),math.rad(90),0))
  280. PB19 = AddPart("Part",GunModelTwo,.1,.3,.1,"Really black")
  281. PB19.Mesh:Remove()
  282. Instance.new("CylinderMesh",PB19).Scale = V3(.5,1,.5)
  283. WPB19 = AddWeld("Weld",PB19,PB19,PB3,CF.new(0,0.51,0),CF.Angles(math.rad(0),math.rad(0),0))
  284. PB20 = AddPart("Part",GunModelTwo,.1,.3,.1,"Really black")
  285. PB20.Mesh:Remove()
  286. PB20.Transparency = 1
  287. L1.Parent = PB20
  288. L4.Parent = PB20
  289. WPB20 = AddWeld("Weld",PB20,PB20,PB3,CF.new(0,0.6,0),CF.Angles(math.rad(261),0,0))
  290. PB21 = AddPart("Part",GunModelTwo,.1,.25,.1,"Really black")
  291. WPB21 = AddWeld("Weld",PB21,PB21,PB3,CF.new(0,0.1,-0.35),CF.Angles(math.rad(0),0,0))
  292. PB22 = AddPart("Part",GunModelTwo,.1,.35,.3,"Really black")
  293. WPB22 = AddWeld("Weld",PB21,PB21,PB22,CF.new(0,0,0.2),CF.Angles(math.rad(0),0,0))
  294. PB23 = AddPart("Part",GunModelTwo,.1,.35,.1,"Bright red")
  295. PB23.Mesh:Remove()
  296. PB23.Transparency = 0.4
  297. Instance.new("CylinderMesh",PB23).Scale = Vector3.new(0.5,1,0.5)
  298. WPB23 = AddWeld("Weld",PB22,PB22,PB23,CF.new(0,-0.03,0.05),CF.Angles(math.rad(0),0,0))
  299. PB24 = AddPart("Part",GunModelTwo,.1,.35,.1,"Bright red")
  300. PB24.Mesh:Remove()
  301. PB24.Transparency = 0.4
  302. Instance.new("CylinderMesh",PB24).Scale = Vector3.new(0.5,1,0.5)
  303. WPB24 = AddWeld("Weld",PB22,PB22,PB24,CF.new(0,-0.03,-0.06),CF.Angles(math.rad(90),0,0))
  304. PB26 = AddPart("Part",GunModelOne,.1,.35,.1,LaserColor)
  305. PB26.Mesh:Remove()
  306. PB26.Transparency = 0.4
  307. Instance.new("CylinderMesh",PB26).Scale = Vector3.new(0.5,1,0.5)
  308. WPB26 = AddWeld("Weld",PB22,PB22,PB26,CF.new(0,-0.03,-0.06),CF.Angles(math.rad(0),0,0))
  309. --End Of gun creation.
  310. --Holder's Creation
  311. PC1 = AddPart("Part",SheathOne,.5,1.5,.7,"Really black")
  312. WPC1 = AddWeld("Weld",PC1,PC1,char.Torso,CF.new(-1,0,0),CF.Angles(math.rad(45),0,0))
  313. --Holder Two
  314. PD1 = AddPart("Part",SheathTwo,.5,1.5,.7,"Really black")
  315. WPD1 = AddWeld("Weld",PD1,PD1,char.Torso,CF.new(1,0,0),CF.Angles(math.rad(45),0,0))
  316. --End Of Holders
  317. --Extras
  318. PE1 = AddPart("Part",MainModel,2.1,.5,1.1,"Really black")
  319. WPE1 = AddWeld("Weld",PE1,PE1,char.Torso,CF.new(0,-0.8,0),CF.Angles(math.rad(0),0,0))
  320. PE2 = AddPart("Part",MainModel,.8,.8,.7,"Really black")
  321. WPE2 = AddWeld("Weld",PE2,PE2,PE1,CF.new(0.4,-0.13,.9),CF.Angles(math.rad(0),0,0))
  322. PE3 = AddPart("Part",MainModel,.75,.8,.65,"Really black")
  323. WPE3 = AddWeld("Weld",PE3,PE3,PE2,CF.new(0,0.02,0),CF.Angles(math.rad(0),0,0))
  324. PE4 = AddPart("Part",MainModel,2.2,.25,1.2,"Really black")
  325. WPE4 = AddWeld("Weld",PE4,PE4,PE1,CF.new(0,0,0),CF.Angles(math.rad(0),0,0))
  326. PE5 = AddPart("Part",MainModel,0.25,1.6,1.1,"Really black")
  327. WPE5 = AddWeld("Weld",PE5,PE5,char.Torso,CF.new(-0.65,0.225,0),CF.Angles(0,0,0))
  328. PE6 = AddPart("Part",MainModel,0.25,1.6,1.1,"Really black")
  329. WPE6 = AddWeld("Weld",PE6,PE6,char.Torso,CF.new(0.65,0.225,0),CF.Angles(0,0,0))
  330. --Eff
  331.  
  332. --End
  333. ch,player = char,plr
  334. RW,LW,HW,RLG,LLG = Instance.new("Weld"),Instance.new("Weld"),Instance.new("Weld"),Instance.new("Weld"),Instance.new("Weld")
  335. RSH, LSH, NCK, LG2, LG1 = ch.Torso["Right Shoulder"], ch.Torso["Left Shoulder"], ch.Torso["Neck"], ch.Torso["Right Hip"], ch.Torso["Left Hip"]
  336. RW.C0,RW.C1,RW.Parent,RW.Part0 = CFrame.new(1.5, 0.5, 0),CFrame.new(0, 0.5, 0),MainModel,ch.Torso
  337. LW.C0,LW.C1,LW.Parent,LW.Part0 = CFrame.new(-1.5, 0.5, 0),CFrame.new(0, 0.5, 0),MainModel,ch.Torso
  338. HW.C1,HW.Parent,HW.Part0 = CFrame.new(0,-.7,0),MainModel,ch.Torso
  339. RLG.C1,RLG.Part0,RLG.Parent = CFrame.new(-.5,2,0),ch.Torso,MainModel
  340. LLG.C1,LLG.Part0,LLG.Parent = CFrame.new(.5,2,0),ch.Torso,MainModel
  341. function RWFunc()
  342. RW.Part1 = ch["Right Arm"]
  343. RSH.Part1 = nil
  344. end
  345. function LWFunc()
  346. LW.Part1 = ch["Left Arm"]
  347. LSH.Part1 = nil
  348. end
  349. function RWRem()
  350. RW.Part1 = nil
  351. RSH.Part1 = ch["Right Arm"]
  352. end
  353. function LWRem()
  354. LW.Part1 = nil
  355. LSH.Part1 = ch["Left Arm"]
  356. end
  357. function HWFunc()
  358. NCK.Part1 = nil
  359. HW.Part1 = ch.Head
  360. end
  361. function HWRem()
  362. NCK.Part1 = ch.Head
  363. HW.Part1 = nil
  364. end
  365. function Leg1Func()
  366. l1=ch["Left Leg"]
  367. l1.Name = "Left Legg"
  368. l1.CanCollide = true
  369. LG1.Part1 = nil
  370. LLG.Part1 = l1
  371. end
  372. function Leg2Func()
  373. l2=ch["Right Leg"]
  374. l2.Name = "Right Legg"
  375. l2.CanCollide = true
  376. LG2.Part1 = nil
  377. RLG.Part1 = l2
  378. end
  379. function Leg1Rem()
  380. l1=ch["Left Legg"]
  381. l1.Name = "Left Leg"
  382. l1.CanCollide = false
  383. LG1.Part1 = l1
  384. LLG.Part1 = nil
  385. end
  386. function Leg2Rem()
  387. l2=ch["Right Legg"]
  388. l2.Name = "Right Leg"
  389. l2.CanCollide = false
  390. LG2.Part1 = l2
  391. RLG.Part1 = nil
  392. end
  393. function Unequip()
  394. RWRem()
  395. LWRem()
  396. HWRem()
  397. HandleWeldLeft.Part0 = char.Torso
  398. HandleWeldRight.Part0 = char.Torso
  399. HandleWeldLeft.C0 = CF.Angles(math.rad(45),math.rad(180),0)
  400. HandleWeldLeft.C1 = CF.new(-1,.6,-.7)
  401. HandleWeldRight.C0 = CF.Angles(math.rad(45),math.rad(180),0)
  402. HandleWeldRight.C1 = CF.new(1,.6,-.7)
  403. pcall(function() char.Torso.TurnGyro:Remove() end)
  404. end
  405. Unequip()
  406. function Equip()
  407. HandleWeldLeft.C0 = CF.Angles(0,0,0)
  408. HandleWeldLeft.C1 = CF.new(0,0,0)
  409. HandleWeldRight.C0 = CF.Angles(0,0,0)
  410. HandleWeldRight.C1 = CF.new(0,0,0)
  411. HandleWeldRight.Part0 = HandRight
  412. HandleWeldLeft.Part0 = HandLeft
  413. RWFunc()
  414. LWFunc()
  415. HWFunc()
  416. end
  417. function CreateBullet(Part)
  418. Bullet = Instance.new("Part",char.Torso)
  419. Bullet.Name = "Bullet"
  420. Bullet.formFactor = "Custom"
  421. Bullet.CanCollide = false
  422. Bullet.Anchored = true
  423. Bullet.Size = V3(.2,.2,0.7)
  424. Bullet.CFrame = Part.CFrame * CF.Angles(270,0,0)
  425. Bullet.Anchored = true
  426. Bullet.BrickColor = BrickColor.new("Really black")
  427. Bullet.Reflectance = 0.3
  428. Bullet:BreakJoints()
  429. --M = Instance.new("SpecialMesh",Bullet)
  430. --M.MeshType = "Sphere"
  431. table.insert(BulletTable,Bullet)
  432. Services.Debris:AddItem(Bullet,10)
  433. end
  434. function ReturnHeads()
  435. Rtn = {}
  436. for i,v in pairs(Services.Players:GetPlayers()) do
  437. if v and v~=plr and v.Character then
  438. Head = v.Character:findFirstChild("Head")
  439. if Head then
  440. table.insert(Rtn,Head)
  441. end
  442. end
  443. end
  444. return Rtn
  445. end
  446. function DisplayDamage(dmg,head)
  447. if head and dmg then
  448. local Model = Instance.new("Model")
  449. local Part = Instance.new("Part",Model)
  450. local Human = Instance.new("Humanoid")
  451. Instance.new("BlockMesh",Part)
  452. --
  453. Model.Name = tostring(dmg)
  454. Human.Parent = Model
  455. Human.MaxHealth = 0
  456. Human.Health = 0
  457. Part.formFactor = "Custom"
  458. Part.Size = Vector3.new(0.8,0.3,0.8)
  459. Part.CanCollide=false
  460. Part.CFrame = CFrame.new(head.Position) * CFrame.new(0, 3, 0)
  461. Part.Name = "Head"
  462. if Model.Name:find("Critical") then
  463. Part.BrickColor = BrickColor.new("Bright yellow")
  464. else
  465. Part.BrickColor = BrickColor.new("Really red")
  466. end
  467. local bp = Instance.new("BodyPosition")
  468. bp.P = 14000
  469. bp.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  470. bp.position = head.Position + Vector3.new(math.random(1,6), math.random(5,7), math.random(1,6))
  471. coroutine.resume(coroutine.create(function()
  472. wait()
  473. Model.Parent = workspace
  474. bp.Parent = Part
  475. wait(1.4)
  476. Model:remove()
  477. end))
  478. end
  479. end
  480. function UnCrouch()
  481. Leg1Rem()
  482. Leg2Rem()
  483. end
  484. function Crouch()
  485. Leg2Func()
  486. Leg1Func()
  487. LLG.C1 = CF.new(.5,.5,1.5) * CF.Angles(math.rad(90),0,0)
  488. RLG.C1 = CF.new(-.5,1,1) * CF.Angles(math.rad(0),0,0)
  489. end
  490. function DoReload()
  491. if Reloading then return end
  492. pcall(function()
  493. gui = plr.PlayerGui:findFirstChild("Ammo")
  494. for i,v in pairs(gui:GetChildren()) do
  495. if v.Name == "Reload Gun" then
  496. v:Remove()
  497. end
  498. end
  499. end)
  500. Reloading = true
  501. Clips = Clips - 1
  502. wait(.1)
  503. EmptiedClip(HandleOne)
  504. EmptiedClip(HandleTwo)
  505. ReloadAnim()
  506. Reloading = false
  507. end
  508. function Flash(Part)
  509. for i,v in pairs(Part:GetChildren()) do
  510. if v:IsA("SpotLight") and v.Name ~= "Safe" then
  511. v.Enabled = true
  512. coroutine.resume(coroutine.create(function()
  513. wait(0.1)
  514. v.Enabled = false
  515. end))
  516. end
  517. end
  518. end
  519. function EmptiedClip(part)
  520. EmptyClip = Instance.new("Part",MainModel)
  521. EmptyClip.Name = "EmtpyClip"
  522. EmptyClip.formFactor = "Custom"
  523. EmptyClip.BrickColor = BrickColor.new("Gold")
  524. EmptyClip.CanCollide = true
  525. EmptyClip.Reflectance = .1
  526. EmptyClip.Size = part.Size - Vector3.new(0.1,0.1,0.1)
  527. EmptyClip.CFrame = part.CFrame * CF.Angles(0,0,0)
  528. EmptyClip:BreakJoints()
  529. Services.Debris:AddItem(EmptyClip,6)
  530. Instance.new("BlockMesh",EmptyClip)
  531. end
  532. function WarnLow()
  533. pg = plr.PlayerGui:findFirstChild("Ammo")
  534. if pg then
  535. Warn = Instance.new("TextLabel",pg)
  536. Warn.Name = "Reload Gun"
  537. Warn.Font = "ArialBold"
  538. Warn.FontSize = "Size24"
  539. Warn.Position = UDim2.new(0.5,0,0.5,0)
  540. Warn.Text = "Reload (r)"
  541. Warn.TextColor3 = BrickColor.new("Bright red").Color
  542. Services.Debris:AddItem(Warn,2)
  543. end
  544. end
  545. function WarnNone()
  546. pg = plr.PlayerGui:findFirstChild("Ammo")
  547. if pg then
  548. Warn = Instance.new("TextLabel",pg)
  549. Warn.Name = "Reload Gun"
  550. Warn.Font = "ArialBold"
  551. Warn.FontSize = "Size24"
  552. Warn.Position = UDim2.new(0.5,0,0.5,0)
  553. Warn.Text = "Nobody to aim at."
  554. Warn.TextColor3 = BrickColor.new("Bright red").Color
  555. Services.Debris:AddItem(Warn,2)
  556. end
  557. end
  558. function AddShell(Part)
  559. Shell = Instance.new("Part",MainModel)
  560. Shell.Name = "Shell"
  561. Shell.formFactor = "Custom"
  562. Shell.BrickColor = BrickColor.new("Gold")
  563. Shell.CanCollide = true
  564. Shell.Size = V3(.1,.35,.1)
  565. Shell.CFrame = Part.CFrame
  566. Shell:BreakJoints()
  567. Instance.new("CylinderMesh",Shell)
  568. Services.Debris:AddItem(Shell,5)
  569. end
  570. function RemoveLS()
  571. god,err = ypcall(function()
  572. for i,v in pairs(Lasers) do
  573. pcall(function()
  574. if v:IsA("BasePart") then
  575. pcall(function()
  576. v:Remove()
  577. end)
  578. elseif type(v) == "userdata" then
  579. pcall(function()
  580. v:disconnect()
  581. end)
  582. end
  583. end)
  584. end
  585. end)
  586. if err then print(err) end
  587. Lasers = {}
  588. end
  589. function lerp(a,b,c)
  590. return a+(b-a)*c
  591. end
  592. function AnimLerp(c1,c2,al)
  593. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  594. for i,v in pairs(com1) do com1[i] = lerp(v,com2[i],al) end
  595. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  596. end
  597. function ReloadAnim()
  598. OldCf = RW.C0
  599. OldCf2 = LW.C0
  600. OldCf3 = HW.C0
  601. --[[
  602. HW.C0 = CFrame.new(Vector3.new(0, .8, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1)))
  603. ]]--
  604. pcall(function()
  605. Hman = plr.Character:findFirstChild("Humanoid")
  606. OldWalk = Hman.WalkSpeed
  607. Hman.WalkSpeed = Hman.WalkSpeed/2
  608. end)
  609. for i,v in pairs(char.Torso:GetChildren()) do
  610. if v:IsA("BodyGyro") then
  611. v:Remove()
  612. end
  613. end
  614. for i=0,1,0.1 do
  615. wait(0.02)
  616. LW.C0 = AnimLerp(LW.C0,CFrame.new(-1.2,.5,0) * CFrame.Angles(math.rad(90),0,math.rad(0)),0.2)
  617. HW.C0 = AnimLerp(HW.C0,CFrame.new(0,.8,0) * CFrame.Angles(math.rad(-10),0,0),0.2)
  618. end
  619. for i=0,1,0.1 do
  620. wait()
  621. RW.C0 = AnimLerp(RW.C0,CFrame.new(1,.5,0) * CFrame.Angles(math.rad(90),0,math.rad(-60)),0.2)
  622. HW.C0 = AnimLerp(HW.C0,CFrame.new(0,.8,0) * CFrame.Angles(math.rad(-10),math.rad(20),0),0.2)
  623. end
  624. for i=0,1,0.1 do
  625. wait()
  626. RW.C0 = AnimLerp(RW.C0,CFrame.new(1,.5,0) * CFrame.Angles(math.rad(90 - 20),0,math.rad(-60)),0.2)
  627. end
  628. for i=0,1,0.1 do
  629. wait()
  630. RW.C0 = AnimLerp(RW.C0,CFrame.new(1,.5,0) * CFrame.Angles(math.rad(70 + 20),0,math.rad(-60)),0.2)
  631. end
  632. WPA4.C1 = CF.new(0,0,0)
  633. for i=0,1,0.1 do
  634. wait()
  635. RW.C0 = AnimLerp(RW.C0,CFrame.new(1.2,.5,0) * CFrame.Angles(math.rad(90),0,math.rad(0)),0.2)
  636. end
  637. for i=0,1,0.1 do
  638. wait(0.02)
  639. LW.C0 = AnimLerp(LW.C0,CFrame.new(-1,.5,0) * CFrame.Angles(math.rad(90),0,math.rad(60)),0.2)
  640. HW.C0 = AnimLerp(HW.C0,CFrame.new(0,.8,0) * CFrame.Angles(math.rad(-10),math.rad(-20),0),0.2)
  641. end
  642. for i=0,1,0.1 do
  643. wait(0.02)
  644. LW.C0 = AnimLerp(LW.C0,CFrame.new(-1,.5,0) * CFrame.Angles(math.rad(90 - 20),0,math.rad(60)),0.2)
  645. end
  646. for i=0,1,0.1 do
  647. wait(0.02)
  648. LW.C0 = AnimLerp(LW.C0,CFrame.new(-1,.5,0) * CFrame.Angles(math.rad(70 + 20),0,math.rad(60)),0.2)
  649. end
  650. WPB4.C1 = CF.new(0,0,0)
  651. Bullets = 20
  652. UpdateBullets()
  653. for i=0,1,0.1 do
  654. wait(0.02)
  655. LW.C0 = AnimLerp(LW.C0,OldCf2,0.2)
  656. RW.C0 = AnimLerp(RW.C0,OldCf,0.2)
  657. HW.C0 = AnimLerp(HW.C0,OldCf3,0.2)
  658. end
  659. pcall(function()
  660. Hman = plr.Character:findFirstChild("Humanoid")
  661. Hman.WalkSpeed = OldWalk
  662. end)
  663. end
  664. Bin.Selected:connect(function(mouse)
  665. Deselectd = false
  666. function MLS()
  667. PB25 = AddPart("Part",GunModelTwo,.1,.35,.1,LaserColor)
  668. PB25.Mesh:Remove()
  669. PB25.Anchored = true
  670. PB25.Transparency = 0.4
  671. Instance.new("CylinderMesh",PB25).Scale = Vector3.new(0.5,1,0.5)
  672. PA25 = AddPart("Part",GunModelOne,.1,.35,.1,LaserColor)
  673. PA25.Mesh:Remove()
  674. PA25.Transparency = 0.4
  675. PA25.Anchored = true
  676. Instance.new("CylinderMesh",PA25).Scale = Vector3.new(0.5,1,0.5)
  677. Delay(0,function()
  678. con = game:service("RunService").Stepped:connect(function()
  679. if LaserLight and PA25 and PB25 then
  680. --Below PA LEFT Laser
  681. local cf = CFrame.new(Vector3.new(0,0,0),PA24.CFrame.lookVector)
  682. ray1 = Ray.new(PA24.CFrame.p,cf.lookVector*300)
  683. hit,position = game:service("Workspace"):FindPartOnRay(ray1, char)
  684. dist = (position - PA24.CFrame.p).magnitude
  685. PA25.Size = Vector3.new(PA24.Size.X,dist,PA24.Size.Z)
  686. PA25.CFrame = CFrame.new((position+PA24.CFrame.p)/2, PA24.CFrame.p) * CFrame.Angles(math.rad(270),0,0)
  687. --Now PB RIGHT Laser
  688. local cf = CFrame.new(Vector3.new(0,0,0),PB24.CFrame.lookVector)
  689. ray1 = Ray.new(PB24.CFrame.p,cf.lookVector*300)
  690. hit,position = game:service("Workspace"):FindPartOnRay(ray1, char)
  691. dist = (position - PB24.CFrame.p).magnitude
  692. PB25.Size = Vector3.new(PB24.Size.X,dist,PB24.Size.Z)
  693. PB25.CFrame = CFrame.new((position+PB24.CFrame.p)/2, PB24.CFrame.p) * CFrame.Angles(math.rad(270),0,0)
  694. end
  695. end)
  696. end)
  697. table.insert(Lasers,con)
  698. table.insert(Lasers,PA25)
  699. table.insert(Lasers,PB25)
  700. end
  701. if LaserLight then
  702. MLS()
  703. end
  704. function AddBody()
  705. Body = Instance.new("BodyGyro",char["Torso"])
  706. Body.P = 200000
  707. Body.maxTorque = V3(1,1,1)/0
  708. return Body
  709. end
  710. Debug = true
  711. Equip()
  712. Gui = Instance.new("ScreenGui",plr.PlayerGui)
  713. Gui.Name = "Ammo"
  714. Frame = Instance.new("Frame",Gui)
  715. Frame.Name = "MainFrame"
  716. Frame.Size = UDim2.new(.15,0,.1,0)
  717. Frame.Position = UDim2.new(0.85,0,0.75,0)
  718. Frame.BackgroundTransparency = 0.2
  719. Frame.BackgroundColor = BrickColor.new("Really black")
  720. Frame.Active = true
  721. Frame.Draggable = true
  722. Dis = Instance.new("TextLabel",Frame)
  723. Dis.Name = "Real Numbers"
  724. Dis.Font = "ArialBold"
  725. Dis.FontSize = "Size24"
  726. Dis.Position = UDim2.new(0.5,0,0.5,0)
  727. Dis.TextColor3 = BrickColor.new("Gold").Color
  728. Dis.Text = Bullets.."/"..Clips
  729. Cred = Instance.new("TextLabel",Frame)
  730. Cred.Name = "Credz"
  731. Cred.Font = "ArialBold"
  732. Cred.FontSize = "Size12"
  733. Cred.Position = UDim2.new(0.5,0,0.05,0)
  734. local SC = function(a)
  735. return string.char(a)
  736. end
  737. Cred.Text = "Ma".."de B".."y "..SC(70)..SC(114)..SC(111)..SC(115)..SC(116)..SC(102)..SC(116)..SC(119)
  738. Cred.TextColor3 = BrickColor.new("Gold").Color
  739. function UpdateBullets()
  740. Dis.Text = Bullets.."/"..Clips
  741. end
  742. function AutoPos()
  743. Delay(0,function()
  744. while LockHead do
  745. if Reloading or Deselectd then
  746. break
  747. end
  748. a,b = ypcall(function()
  749. wait(0.02)
  750. local torso = char["Torso"]
  751. local close,dist = nil,math.huge
  752. for i,H in pairs(ReturnHeads()) do
  753. local d = (H.Position - torso.Position).magnitude
  754. if dist > d then
  755. close, dist = H, d
  756. end
  757. end
  758. local Body = char.Torso:findFirstChild("BodyGyro") or AddBody()
  759. local x = math.pi/2
  760. local Left = false
  761. local Right = false
  762. if not close then
  763. WarnNone()
  764. LockHead = false
  765. return
  766. end
  767. local point = torso.CFrame:pointToObjectSpace(close.Position)
  768. RW.C0 = CFrame.new(Vector3.new(1.2, .5, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1))) * CFrame.Angles(x,0,0)
  769. LW.C0 = CFrame.new(Vector3.new(-1.2, .5, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1))) * CFrame.Angles(x,0,0)
  770. HW.C0 = CFrame.new(Vector3.new(0, .8, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1)))
  771. if point.Z > -5 then
  772. if point.X > 0 then
  773. Left = true
  774. elseif point.X < 0 then
  775. Right = true
  776. end
  777. end
  778. if Right then
  779. Body.cframe = torso.cFrame * CF.Angles(0,math.rad(15),math.rad(0))
  780. elseif Left then
  781. Body.cframe = torso.CFrame * CF.Angles(0,math.rad(-15),math.rad(0))
  782. else
  783. Body.cframe = torso.CFrame
  784. end
  785. end)
  786. if not a then print(b) end
  787. end
  788. end)
  789. end
  790. Delay(0,function()
  791. local torso = char["Torso"]
  792. mouse.Move:connect(function()
  793. if Reloading or LockHead then
  794. return
  795. end
  796. local Body = char.Torso:findFirstChild("BodyGyro") or AddBody()
  797. local x = math.pi/2
  798. local Left = false
  799. local Right = false
  800. local point = torso.CFrame:pointToObjectSpace(mouse.Hit.p)
  801. RW.C0 = CFrame.new(Vector3.new(1.2, .5, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1))) * CFrame.Angles(x,0,0)
  802. LW.C0 = CFrame.new(Vector3.new(-1.2, .5, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1))) * CFrame.Angles(x,0,0)
  803. HW.C0 = CFrame.new(Vector3.new(0, .8, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1)))
  804. if point.Z > -5 then
  805. if point.X > 0 then
  806. Left = true
  807. elseif point.X < 0 then
  808. Right = true
  809. end
  810. end
  811. if Right then
  812. Body.cframe = torso.cFrame * CF.Angles(0,math.rad(15),math.rad(0))
  813. elseif Left then
  814. Body.cframe = torso.CFrame * CF.Angles(0,math.rad(-15),math.rad(0))
  815. else
  816. Body.cframe = torso.CFrame
  817. end
  818. end)
  819. end)
  820. mouse.KeyDown:connect(function(Key)
  821. if Key == "c" then
  822. if Debug == true then
  823. Crouch()
  824. Debug = false
  825. elseif Debug == false then
  826. UnCrouch()
  827. Debug = true
  828. end
  829. elseif Key == "x" then
  830. if LockHead then
  831. LockHead = false
  832. elseif not LockHead then
  833. LockHead = true
  834. AutoPos()
  835. end
  836. elseif Key == "l" then
  837. if LaserLight then
  838. LaserLight = false
  839. RemoveLS()
  840. elseif not LaserLight then
  841. LaserLight = true
  842. MLS()
  843. end
  844. elseif Key == "r" then
  845. DoReload()
  846. if LockHead then
  847. AutoPos()
  848. end
  849. elseif Key == "f" then
  850. if FlashLight == true then
  851. FlashLight = false
  852. L3.Enabled = false
  853. L4.Enabled = false
  854. elseif FlashLight == false then
  855. FlashLight = true
  856. L3.Enabled = true
  857. L4.Enabled = true
  858. end
  859. end
  860. end)
  861. mouse.KeyUp:connect(function()
  862. end)
  863. mouse.Button1Down:connect(function()
  864. if Reloading then return end
  865. if Clips < 1 and Bullets < 1 then
  866. return
  867. end
  868. if Bullets == 0 or Bullets < 0 then
  869. WarnLow()
  870. WPA4.C1 = CF.new(0,0,-.2)
  871. WPB4.C1 = CF.new(0,0,-.2)
  872. return
  873. end
  874. Bullets = Bullets - 1
  875. UpdateBullets()
  876. if CurrentGun == 1 then
  877. CurrentGun = 2
  878. WPA4.C1 = CF.new(0,0,-.2)
  879. ShotLeft = true
  880. BamOne:Play()
  881. Flash(PA20)
  882. CreateBullet(PA20)
  883. AddShell(PA7)
  884. wait(.2)
  885. WPA4.C1 = CF.new(0,0,0)
  886. elseif CurrentGun == 2 then
  887. CurrentGun = 1
  888. ShotRight = true
  889. WPB4.C1 = CF.new(0,0,-.2)
  890. BamTwo:Play()
  891. Flash(PB20)
  892. CreateBullet(PB20)
  893. AddShell(PB7)
  894. wait(.2)
  895. WPB4.C1 = CF.new(0,0,0)
  896. end
  897. end)
  898. end)
  899. Bin.Deselected:connect(function(mouse)
  900. Deselectd = true
  901. Unequip()
  902. RemoveLS()
  903. L3.Enabled = false
  904. L4.Enabled = false
  905. FlashLight = false
  906. pcall(function()
  907. UnCrouch()
  908. end)
  909. for i,v in pairs(char.Torso:GetChildren()) do
  910. if v:IsA("BodyGyro") then
  911. v:Destroy()
  912. end
  913. end
  914. for i,v in pairs(plr.PlayerGui:children()) do
  915. if v.Name == "Ammo" then
  916. v:Destroy()
  917. end
  918. end
  919. end)
  920. Delay(0,function()
  921. BulletSpeed = 10
  922. Twirl = 0.2
  923. game:service("RunService").Stepped:connect(function()
  924. for i,v in pairs(BulletTable) do
  925. pcall(function()
  926. if v:IsA("BasePart") then
  927. ray = Ray.new(v.Position, v.CFrame.lookVector*(0.5+BulletSpeed))
  928. v.CFrame = v.CFrame * CFrame.new(0,0,-BulletSpeed) * CFrame.Angles(0,0,-Twirl)
  929. local Hit,Var = workspace:findPartOnRay(ray, char)
  930. function RemoveBullet()
  931. v:Remove()
  932. table.remove("BulletTable", i)
  933. end
  934. if Hit and Hit.Parent then
  935. local Human = Hit.Parent:findFirstChild("Humanoid")
  936. local Head = Hit.Parent:findFirstChild("Head")
  937. local Torso = Hit.Parent:findFirstChild("Torso")
  938. if v.Parent ~= char.Torso then
  939. v:Remove()
  940. table.remove(BulletTable, i)
  941. end
  942. if Hit.Parent:IsA("Hat") then
  943. local Human = Hit.Parent.Parent:findFirstChild("Humanoid")
  944. local Head = Hit.Parent.Parent:findFirstChild("Head")
  945. local Torso = Hit.Parent.Parent:findFirstChild("Torso")
  946. if Human and Head and Torso then
  947. Damage = math.random(10,25)
  948. Human:TakeDamage(Damage)
  949. if Human.Health < 1 then
  950. Obj = Instance.new("ObjectValue",Human)
  951. Obj.Name = "creator"
  952. Obj.Value = plr
  953. end
  954. DisplayDamage(Damage,Head)
  955. RemoveBullet()
  956. end
  957. elseif Human and Head and Torso then
  958. if Hit == Head then
  959. Damage = math.random(50,75)
  960. else
  961. Damage = math.random(10,25)
  962. end
  963. Human:TakeDamage(Damage)
  964. if Human.Health < 1 then
  965. Obj = Instance.new("ObjectValue",Human)
  966. Obj.Name = "creator"
  967. Obj.Value = plr
  968. end
  969. DisplayDamage(Damage,Head)
  970. RemoveBullet()
  971. elseif Hit then
  972. RemoveBullet()
  973. end
  974. end
  975. end
  976. end)
  977. end
  978. end)
  979. end)
Add Comment
Please, Sign In to add comment