Advertisement
KHSora455

Dual Pistols

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