Advertisement
AlphaPhoenix21

M1911 Akimbo (Edit)

Feb 20th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.30 KB | None | 0 0
  1. function clerp(c1,c2,al)
  2. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  3. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  4. for i,v in pairs(com1) do
  5. com1[i] = v+(com2[i]-v)*al
  6. end
  7. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  8. end
  9.  
  10. plr = game:service'Players'.LocalPlayer
  11. plrgui = plr:findFirstChild'PlayerGui'
  12. plrmouse = plr:GetMouse()
  13. char = plr.Character
  14. humanoid = char:findFirstChild("Humanoid")
  15. torso = char:findFirstChild("Torso")
  16. head = char.Head
  17. ra = char:findFirstChild("Right Arm")
  18. la = char:findFirstChild("Left Arm")
  19. rl = char:findFirstChild("Right Leg")
  20. ll = char:findFirstChild("Left Leg")
  21. rs = torso:findFirstChild("Right Shoulder")
  22. ls = torso:findFirstChild("Left Shoulder")
  23. rh = torso:findFirstChild("Right Hip")
  24. lh = torso:findFirstChild("Left Hip")
  25. neck = torso:findFirstChild("Neck")
  26. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  27. rootpart = char:findFirstChild("HumanoidRootPart")
  28. camera = workspace.CurrentCamera
  29. anim = char:findFirstChild("Animate")
  30.  
  31. local rm = Instance.new("Weld")
  32. rm.C0 = CFrame.new(1.5, 0.5, 0)
  33. rm.C1 = CFrame.new(0, 0.5, 0)
  34. rm.Part0 = torso
  35. rm.Part1 = ra
  36. rm.Name = 'Right Shoulder'
  37.  
  38. local lm = Instance.new("Weld")
  39. lm.C0 = CFrame.new(-1.5, 0.5, 0)
  40. lm.C1 = CFrame.new(0, 0.5, 0)
  41. lm.Part0 = torso
  42. lm.Part1 = la
  43. lm.Name = 'Left Shoulder'
  44.  
  45. local tool = Instance.new('HopperBin', plr.Backpack)
  46. tool.Name = 'Dual M1911'
  47.  
  48. function scan(parent)
  49. local parts,last = {}
  50. for _,v in pairs(parent:GetChildren()) do
  51. if (v:IsA("BasePart")) then
  52. v.Anchored = true
  53. if (last) then
  54. local w = Instance.new("Weld")
  55. w.Name = ("%s_Weld"):format(v.Name)
  56. w.Part0,w.Part1 = last,v
  57. w.C0 = last.CFrame:inverse()
  58. w.C1 = v.CFrame:inverse()
  59. w.Parent = last
  60. end
  61. last = v
  62. table.insert(parts,v)
  63. end
  64. scan(v)
  65. end
  66. for _,v in pairs(parts) do
  67. v.Anchored = false
  68. v.Locked = true
  69. v.CanCollide = false
  70. end
  71. end
  72.  
  73. --1-Torso
  74. holsters=Instance.new("Model")
  75. holsters.Name="Torso"
  76. holsters.Parent=char
  77. --2-HolsterWeldTo2
  78. obj2=Instance.new("Part")
  79. obj2.CFrame=CFrame.new(Vector3.new(14.8519955,1.44200003,35.6479988)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126)
  80. obj2.FormFactor=Enum.FormFactor.Custom
  81. obj2.LeftSurface=10
  82. obj2.Transparency=1
  83. obj2.TopSurface=10
  84. obj2.RightSurface=10
  85. obj2.Material="SmoothPlastic"
  86. obj2.Size=Vector3.new(0.200000003,0.200000003,1.60000014)
  87. obj2.FrontSurface=10
  88. obj2.BottomSurface=10
  89. obj2.BackSurface=10
  90. obj2.BrickColor=BrickColor.new("Brown")
  91. obj2.Name="HolsterWeldTo2"
  92. obj2.Parent=holsters
  93. --3-Mesh
  94. obj3=Instance.new("BlockMesh")
  95. obj3.Scale=Vector3.new(0.999499977,1,1)
  96. obj3.Parent=obj2
  97. --4-Belt
  98. obj4=Instance.new("Part")
  99. obj4.CFrame=CFrame.new(Vector3.new(13.6000061,1.49000156,35.8999977)) * CFrame.Angles(-1.4901162970204e-008,0,-0)
  100. obj4.FormFactor=Enum.FormFactor.Custom
  101. obj4.LeftSurface=10
  102. obj4.TopSurface=10
  103. obj4.RightSurface=10
  104. obj4.Material="SmoothPlastic"
  105. obj4.Size=Vector3.new(2,0.200000003,1)
  106. obj4.FrontSurface=10
  107. obj4.BottomSurface=10
  108. obj4.BackSurface=10
  109. obj4.BrickColor=BrickColor.new("Brown")
  110. obj4.Name="Belt"
  111. obj4.Parent=holsters
  112. --5-Mesh
  113. obj5=Instance.new("BlockMesh")
  114. obj5.Scale=Vector3.new(1.10000002,1,1.10000002)
  115. obj5.Parent=obj4
  116. --6-Hold2
  117. obj6=Instance.new("Part")
  118. obj6.CFrame=CFrame.new(Vector3.new(14.8000011,1.0950017,35.6999893)) * CFrame.Angles(0.26179936528206,0,-0)
  119. obj6.FormFactor=Enum.FormFactor.Custom
  120. obj6.LeftSurface=10
  121. obj6.TopSurface=10
  122. obj6.RightSurface=10
  123. obj6.Material="SmoothPlastic"
  124. obj6.Size=Vector3.new(0.400000006,1.00999999,0.600000024)
  125. obj6.FrontSurface=10
  126. obj6.BottomSurface=10
  127. obj6.BackSurface=10
  128. obj6.BrickColor=BrickColor.new("Brown")
  129. obj6.Name="Hold2"
  130. obj6.Parent=holsters
  131. --7-TorsoWeld
  132. obj7=Instance.new("Part")
  133. obj7.CFrame=CFrame.new(Vector3.new(13.6000061,1.99000168,35.8999939)) * CFrame.Angles(-0,0,-0)
  134. obj7.FormFactor=Enum.FormFactor.Custom
  135. obj7.LeftSurface=10
  136. obj7.Transparency=1
  137. obj7.TopSurface=10
  138. obj7.RightSurface=10
  139. obj7.Size=Vector3.new(2,2,1)
  140. obj7.FrontSurface=10
  141. obj7.BottomSurface=10
  142. obj7.BackSurface=10
  143. obj7.BrickColor=BrickColor.new("Bright blue")
  144. obj7.Name="TorsoWeld"
  145. obj7.Parent=holsters
  146. --8-HolsterWeldTo
  147. obj8=Instance.new("Part")
  148. obj8.CFrame=CFrame.new(Vector3.new(12.342,1.44200003,35.6479988)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126)
  149. obj8.FormFactor=Enum.FormFactor.Custom
  150. obj8.LeftSurface=10
  151. obj8.Transparency=1
  152. obj8.TopSurface=10
  153. obj8.RightSurface=10
  154. obj8.Material="SmoothPlastic"
  155. obj8.Size=Vector3.new(0.200000003,0.200000003,1.60000014)
  156. obj8.FrontSurface=10
  157. obj8.BottomSurface=10
  158. obj8.BackSurface=10
  159. obj8.BrickColor=BrickColor.new("Brown")
  160. obj8.Name="HolsterWeldTo"
  161. obj8.Parent=holsters
  162. --9-Mesh
  163. obj9=Instance.new("BlockMesh")
  164. obj9.Scale=Vector3.new(0.999499977,1,1)
  165. obj9.Parent=obj8
  166. --10-Hold
  167. obj10=Instance.new("Part")
  168. obj10.CFrame=CFrame.new(Vector3.new(12.4000053,1.09500158,35.6999893)) * CFrame.Angles(0.26179936528206,0,-0)
  169. obj10.FormFactor=Enum.FormFactor.Custom
  170. obj10.LeftSurface=10
  171. obj10.TopSurface=10
  172. obj10.RightSurface=10
  173. obj10.Material="SmoothPlastic"
  174. obj10.Size=Vector3.new(0.400000006,1.00999999,0.600000024)
  175. obj10.FrontSurface=10
  176. obj10.BottomSurface=10
  177. obj10.BackSurface=10
  178. obj10.BrickColor=BrickColor.new("Brown")
  179. obj10.Name="Hold"
  180. obj10.Parent=holsters
  181. holsters:MakeJoints()
  182. scan(holsters)
  183.  
  184. --1-M1911
  185. gun=Instance.new("Model")
  186. gun.Name="M1911"
  187. gun.Parent=char
  188. --2-Handle
  189. obj2=Instance.new("Part")
  190. obj2.CFrame=CFrame.new(Vector3.new(12.3420238,1.86332655,36.3927727)) * CFrame.Angles(1.5707963705063,-4.4703483581543e-008,3.1415927410126)
  191. obj2.FormFactor=Enum.FormFactor.Custom
  192. obj2.LeftSurface=10
  193. obj2.TopSurface=10
  194. obj2.RightSurface=10
  195. obj2.Material=Enum.Material.Wood
  196. obj2.Size=Vector3.new(0.200000003,0.99999994,0.400000036)
  197. obj2.FrontSurface=10
  198. obj2.BottomSurface=10
  199. obj2.BackSurface=10
  200. obj2.BrickColor=BrickColor.new("Brown")
  201. obj2.Name="Handle"
  202. obj2.Parent=gun
  203. --3-Decor
  204. obj3=Instance.new("Part")
  205. obj3.CFrame=CFrame.new(Vector3.new(12.3420143,2.28510284,35.9773712)) * CFrame.Angles(1.832595705986,0,-3.1415927410126)
  206. obj3.FormFactor=Enum.FormFactor.Custom
  207. obj3.LeftSurface=10
  208. obj3.TopSurface=10
  209. obj3.RightSurface=10
  210. obj3.Material="SmoothPlastic"
  211. obj3.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
  212. obj3.FrontSurface=10
  213. obj3.BottomSurface=10
  214. obj3.BackSurface=10
  215. obj3.BrickColor=BrickColor.new("Dark stone grey")
  216. obj3.Name="Decor"
  217. obj3.Parent=gun
  218. --4-Mesh
  219. obj4=Instance.new("BlockMesh")
  220. obj4.Offset=Vector3.new(0,0.00999999978,0.0399999991)
  221. obj4.Scale=Vector3.new(0.699999988,0.200000003,0.800000012)
  222. obj4.Parent=obj3
  223. --5-Decor
  224. obj5=Instance.new("Part")
  225. obj5.CFrame=CFrame.new(Vector3.new(12.3420143,1.46716928,35.8617401)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126)
  226. obj5.FormFactor=Enum.FormFactor.Custom
  227. obj5.LeftSurface=10
  228. obj5.TopSurface=10
  229. obj5.RightSurface=10
  230. obj5.Material="SmoothPlastic"
  231. obj5.Size=Vector3.new(0.200000003,0.400000006,0.200000003)
  232. obj5.FrontSurface=10
  233. obj5.BottomSurface=10
  234. obj5.BackSurface=10
  235. obj5.BrickColor=BrickColor.new("Dark stone grey")
  236. obj5.Name="Decor"
  237. obj5.Parent=gun
  238. --6-Mesh
  239. obj6=Instance.new("BlockMesh")
  240. obj6.Scale=Vector3.new(0.600000024,1,0.200000003)
  241. obj6.Parent=obj5
  242. --7-Decor
  243. obj7=Instance.new("Part")
  244. obj7.CFrame=CFrame.new(Vector3.new(12.3420124,1.55429673,36.0928192)) * CFrame.Angles(0.45686540007591,-1.1175870895386e-008,3.141592502594)
  245. obj7.FormFactor=Enum.FormFactor.Custom
  246. obj7.LeftSurface=10
  247. obj7.TopSurface=10
  248. obj7.RightSurface=10
  249. obj7.Material="SmoothPlastic"
  250. obj7.Size=Vector3.new(0.200000003,0.310000002,0.200000003)
  251. obj7.FrontSurface=10
  252. obj7.BottomSurface=10
  253. obj7.BackSurface=10
  254. obj7.BrickColor=BrickColor.new("Dark stone grey")
  255. obj7.Name="Decor"
  256. obj7.Parent=gun
  257. --8-Mesh
  258. obj8=Instance.new("BlockMesh")
  259. obj8.Scale=Vector3.new(0.600000024,1,0.200000003)
  260. obj8.Parent=obj7
  261. --9-Decor
  262. obj9=Instance.new("Part")
  263. obj9.CFrame=CFrame.new(Vector3.new(12.3420258,2.21372294,35.8965569)) * CFrame.Angles(0.76370096206665,-1.4901161193848e-008,-3.1415927410126)
  264. obj9.FormFactor=Enum.FormFactor.Custom
  265. obj9.LeftSurface=10
  266. obj9.TopSurface=10
  267. obj9.RightSurface=10
  268. obj9.Material="SmoothPlastic"
  269. obj9.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
  270. obj9.FrontSurface=10
  271. obj9.BottomSurface=10
  272. obj9.BackSurface=10
  273. obj9.BrickColor=BrickColor.new("Dark stone grey")
  274. obj9.Name="Decor"
  275. obj9.Parent=gun
  276. --10-Mesh
  277. obj10=Instance.new("BlockMesh")
  278. obj10.Scale=Vector3.new(0.400000006,0.200000003,1)
  279. obj10.Parent=obj9
  280. --11-Decor
  281. obj11=Instance.new("Part")
  282. obj11.CFrame=CFrame.new(Vector3.new(12.3420229,1.8633275,36.2927704)) * CFrame.Angles(1.5707963705063,-4.4703483581543e-008,3.1415927410126)
  283. obj11.FormFactor=Enum.FormFactor.Custom
  284. obj11.LeftSurface=10
  285. obj11.TopSurface=10
  286. obj11.RightSurface=10
  287. obj11.Material="SmoothPlastic"
  288. obj11.Size=Vector3.new(0.200000003,1.20000005,0.400000036)
  289. obj11.FrontSurface=10
  290. obj11.BottomSurface=10
  291. obj11.BackSurface=10
  292. obj11.BrickColor=BrickColor.new("Dark stone grey")
  293. obj11.Name="Decor"
  294. obj11.Parent=gun
  295. --12-Mesh
  296. obj12=Instance.new("BlockMesh")
  297. obj12.Offset=Vector3.new(0,-0.0700000003,0)
  298. obj12.Scale=Vector3.new(0.995000005,0.949999988,1.20000005)
  299. obj12.Parent=obj11
  300. --13-Decor
  301. obj13=Instance.new("Part")
  302. obj13.CFrame=CFrame.new(Vector3.new(12.3420258,2.30202365,35.8373909)) * CFrame.Angles(1.756756901741,-1.0430812835693e-007,3.1415927410126)
  303. obj13.FormFactor=Enum.FormFactor.Custom
  304. obj13.LeftSurface=10
  305. obj13.TopSurface=10
  306. obj13.RightSurface=10
  307. obj13.Material="SmoothPlastic"
  308. obj13.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
  309. obj13.FrontSurface=10
  310. obj13.BottomSurface=10
  311. obj13.BackSurface=10
  312. obj13.BrickColor=BrickColor.new("Dark stone grey")
  313. obj13.Name="Decor"
  314. obj13.Parent=gun
  315. --14-Mesh
  316. obj14=Instance.new("BlockMesh")
  317. obj14.Scale=Vector3.new(0.400000006,0.200000003,0.400000006)
  318. obj14.Parent=obj13
  319. --15-BulletCase
  320. obj15=Instance.new("Part")
  321. obj15.CFrame=CFrame.new(Vector3.new(12.3420229,1.44165683,35.6482697)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126)
  322. obj15.FormFactor=Enum.FormFactor.Custom
  323. obj15.LeftSurface=10
  324. obj15.TopSurface=10
  325. obj15.RightSurface=10
  326. obj15.Material="SmoothPlastic"
  327. obj15.Size=Vector3.new(0.200000003,0.200000003,1.60000014)
  328. obj15.FrontSurface=10
  329. obj15.BottomSurface=10
  330. obj15.BackSurface=10
  331. obj15.BrickColor=BrickColor.new("Dark stone grey")
  332. obj15.Name="BulletCase"
  333. obj15.Parent=gun
  334. --16-Mesh
  335. obj16=Instance.new("BlockMesh")
  336. obj16.Scale=Vector3.new(0.999499977,1,1)
  337. obj16.Parent=obj15
  338. --17-Flashlight
  339. obj17=Instance.new("Part")
  340. obj17.CFrame=CFrame.new(Vector3.new(12.3420115,0.729269207,35.601902)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126)
  341. obj17.FormFactor=Enum.FormFactor.Custom
  342. obj17.LeftSurface=10
  343. obj17.TopSurface=10
  344. obj17.RightSurface=10
  345. obj17.Material="Neon"
  346. obj17.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
  347. obj17.FrontSurface=10
  348. obj17.BottomSurface=10
  349. obj17.BackSurface=10
  350. obj17.BrickColor=BrickColor.new("Pastel yellow")
  351. obj17.Name="Flashlight"
  352. obj17.Parent=gun
  353. --18-Mesh
  354. obj18=Instance.new("CylinderMesh")
  355. obj18.Offset=Vector3.new(0,0,0.0500000007)
  356. obj18.Scale=Vector3.new(0.5,1.01999998,0.5)
  357. obj18.Parent=obj17
  358. --19-Decor
  359. obj19=Instance.new("Part")
  360. obj19.CFrame=CFrame.new(Vector3.new(12.3420143,2.1178081,35.8290215)) * CFrame.Angles(1.832595705986,0,-3.1415927410126)
  361. obj19.FormFactor=Enum.FormFactor.Custom
  362. obj19.LeftSurface=10
  363. obj19.TopSurface=10
  364. obj19.RightSurface=10
  365. obj19.Material="SmoothPlastic"
  366. obj19.Size=Vector3.new(0.200000003,0.400000036,0.200000003)
  367. obj19.FrontSurface=10
  368. obj19.BottomSurface=10
  369. obj19.BackSurface=10
  370. obj19.BrickColor=BrickColor.new("Black")
  371. obj19.Name="Decor"
  372. obj19.Parent=gun
  373. --20-Mesh
  374. obj20=Instance.new("BlockMesh")
  375. obj20.Scale=Vector3.new(0.5,0.5,1.10000002)
  376. obj20.Parent=obj19
  377. --21-Decor
  378. obj21=Instance.new("Part")
  379. obj21.CFrame=CFrame.new(Vector3.new(12.2895117,2.05304575,35.6843338)) * CFrame.Angles(1.832595705986,1.5699505805969,-3.1415927410126)
  380. obj21.FormFactor=Enum.FormFactor.Custom
  381. obj21.LeftSurface=10
  382. obj21.TopSurface=10
  383. obj21.RightSurface=10
  384. obj21.Material="SmoothPlastic"
  385. obj21.Size=Vector3.new(0.399999976,0.200000003,0.200000003)
  386. obj21.FrontSurface=10
  387. obj21.BottomSurface=10
  388. obj21.BackSurface=10
  389. obj21.BrickColor=BrickColor.new("Dark stone grey")
  390. obj21.Name="Decor"
  391. obj21.Parent=gun
  392. --22-Mesh
  393. obj22=Instance.new("SpecialMesh")
  394. obj22.MeshType=Enum.MeshType.Wedge
  395. obj22.Scale=Vector3.new(1,0.25,0.50999999)
  396. obj22.Parent=obj21
  397. --23-Decor
  398. obj23=Instance.new("Part")
  399. obj23.CFrame=CFrame.new(Vector3.new(12.3420172,1.41577363,35.744442)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126)
  400. obj23.FormFactor=Enum.FormFactor.Custom
  401. obj23.LeftSurface=10
  402. obj23.TopSurface=10
  403. obj23.RightSurface=10
  404. obj23.Material="SmoothPlastic"
  405. obj23.Size=Vector3.new(0.200000003,1.60000002,0.200000003)
  406. obj23.FrontSurface=10
  407. obj23.BottomSurface=10
  408. obj23.BackSurface=10
  409. obj23.BrickColor=BrickColor.new("Dark stone grey")
  410. obj23.Name="Decor"
  411. obj23.Parent=gun
  412. --24-Mesh
  413. obj24=Instance.new("CylinderMesh")
  414. obj24.Parent=obj23
  415. --25-ShellCaseSpawner
  416. obj25=Instance.new("Part")
  417. obj25.CFrame=CFrame.new(Vector3.new(12.3420172,1.75731552,35.6289024)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126)
  418. obj25.FormFactor=Enum.FormFactor.Custom
  419. obj25.LeftSurface=10
  420. obj25.TopSurface=10
  421. obj25.RightSurface=10
  422. obj25.Material="SmoothPlastic"
  423. obj25.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
  424. obj25.FrontSurface=10
  425. obj25.BottomSurface=10
  426. obj25.BackSurface=10
  427. obj25.Name="ShellCaseSpawner"
  428. obj25.Parent=gun
  429. --26-Mesh
  430. obj26=Instance.new("CylinderMesh")
  431. obj26.Offset=Vector3.new(0.0149999997,0,-0.0350000001)
  432. obj26.Scale=Vector3.new(0.75,1,0.75)
  433. obj26.Parent=obj25
  434. --27-Decor
  435. obj27=Instance.new("Part")
  436. obj27.CFrame=CFrame.new(Vector3.new(12.3420115,0.765501678,35.4666672)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126)
  437. obj27.FormFactor=Enum.FormFactor.Custom
  438. obj27.LeftSurface=10
  439. obj27.TopSurface=10
  440. obj27.RightSurface=10
  441. obj27.Material="SmoothPlastic"
  442. obj27.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
  443. obj27.FrontSurface=10
  444. obj27.BottomSurface=10
  445. obj27.BackSurface=10
  446. obj27.BrickColor=BrickColor.new("Black")
  447. obj27.Name="Decor"
  448. obj27.Parent=gun
  449. --28-Mesh
  450. obj28=Instance.new("CylinderMesh")
  451. obj28.Offset=Vector3.new(0,0,0.0500000007)
  452. obj28.Scale=Vector3.new(0.5,1.01999998,0.5)
  453. obj28.Parent=obj27
  454. --29-Decor
  455. obj29=Instance.new("Part")
  456. obj29.CFrame=CFrame.new(Vector3.new(12.3920164,1.4734931,35.5290413)) * CFrame.Angles(-1.3089969158173,-1.5701057910919,-0)
  457. obj29.FormFactor=Enum.FormFactor.Custom
  458. obj29.LeftSurface=10
  459. obj29.TopSurface=10
  460. obj29.RightSurface=10
  461. obj29.Material="SmoothPlastic"
  462. obj29.Size=Vector3.new(1.60000002,0.200000003,0.200000003)
  463. obj29.FrontSurface=10
  464. obj29.BottomSurface=10
  465. obj29.BackSurface=10
  466. obj29.BrickColor=BrickColor.new("Dark stone grey")
  467. obj29.Name="Decor"
  468. obj29.Parent=gun
  469. --30-Mesh
  470. obj30=Instance.new("SpecialMesh")
  471. obj30.MeshType=Enum.MeshType.Wedge
  472. obj30.Scale=Vector3.new(1,0.25,0.5)
  473. obj30.Parent=obj29
  474. --31-Decor
  475. obj31=Instance.new("Part")
  476. obj31.CFrame=CFrame.new(Vector3.new(12.2895117,1.18371284,35.4513969)) * CFrame.Angles(1.832595705986,1.5699505805969,-3.1415927410126)
  477. obj31.FormFactor=Enum.FormFactor.Custom
  478. obj31.LeftSurface=10
  479. obj31.TopSurface=10
  480. obj31.RightSurface=10
  481. obj31.Material="SmoothPlastic"
  482. obj31.Size=Vector3.new(1,0.200000003,0.200000003)
  483. obj31.FrontSurface=10
  484. obj31.BottomSurface=10
  485. obj31.BackSurface=10
  486. obj31.BrickColor=BrickColor.new("Dark stone grey")
  487. obj31.Name="Decor"
  488. obj31.Parent=gun
  489. --32-Mesh
  490. obj32=Instance.new("SpecialMesh")
  491. obj32.MeshType=Enum.MeshType.Wedge
  492. obj32.Scale=Vector3.new(1,0.25,0.50999999)
  493. obj32.Parent=obj31
  494. gun:MakeJoints()
  495. scan(gun)
  496.  
  497. local gun2 = gun:clone()
  498. gun2.Parent = char
  499.  
  500. local torsoweld = Instance.new('Weld', char)
  501. torsoweld.Part0 = torso
  502. torsoweld.Part1 = holsters.TorsoWeld
  503. torsoweld.C1 = CFrame.Angles(0,math.pi,0)
  504.  
  505. local gunweld = Instance.new('Weld', char)
  506. gunweld.Part0 = gun.BulletCase
  507. gunweld.Part1 = holsters.HolsterWeldTo
  508.  
  509. local gunweld2 = Instance.new('Weld', char)
  510. gunweld2.Part0 = gun2.BulletCase
  511. gunweld2.Part1 = holsters.HolsterWeldTo2
  512.  
  513. local bodygyro = Instance.new('BodyGyro')
  514. bodygyro.maxTorque = Vector3.new(14e16,14e16,14e16)
  515. bodygyro.P = 15000
  516.  
  517. local rsc0 = rm.C0
  518. local lsc0 = lm.C0
  519. local angle = 0
  520. local anglespeed = .5
  521. local speed = .3
  522. local side = 0
  523. local Equipped = false
  524. local origneckc0 = neck.C0
  525. local origneckc1 = neck.C1
  526. local neckc0 = CFrame.new(0, 1, 0)
  527. local firing = false
  528. local pistol = 1
  529. local light = false
  530.  
  531. local gunlight = Instance.new('SpotLight', gun.Flashlight)
  532. gunlight.Range = 60
  533. gunlight.Angle = 25
  534. gunlight.Face = 'Bottom'
  535. gunlight.Shadows = true
  536. gunlight.Enabled = false
  537.  
  538. local gunlight2 = gunlight:clone()
  539. gunlight2.Parent = gun2.Flashlight
  540.  
  541. local fire = Instance.new('Sound', head)
  542. fire.SoundId = "rbxassetid://1045539190"
  543. fire.Volume = 3.2
  544.  
  545. local reload = Instance.new('Sound', head)
  546. reload.SoundId = "rbxassetid://420991108"
  547. reload.Volume = 2.1
  548.  
  549. local ammo = 14
  550. local scrgui = Instance.new('ScreenGui', plrgui)
  551. scrgui.Name = 'DualGunsGui'
  552.  
  553. local ammonution = Instance.new('TextLabel', scrgui)
  554. ammonution.Size = UDim2.new(0,150,0,50)
  555. ammonution.Position = UDim2.new(1, -250, 1, -70)
  556. ammonution.BackgroundTransparency = 1
  557. ammonution.TextColor3 = Color3.new(1,1,1)
  558. ammonution.TextStrokeTransparency = .1
  559. ammonution.Text = ('| '):rep(ammo)
  560. ammonution.TextXAlignment = 'Right'
  561. ammonution.ZIndex = 2
  562. ammonution.FontSize = 'Size18'
  563.  
  564. local ammonution2 = Instance.new('TextLabel', scrgui)
  565. ammonution2.Size = UDim2.new(0,150,0,50)
  566. ammonution2.Position = UDim2.new(1, -250, 1, -70)
  567. ammonution2.BackgroundTransparency = 1
  568. ammonution2.TextColor3 = Color3.new(.5,.5,.5)
  569. ammonution2.TextStrokeTransparency = .1
  570. ammonution2.TextXAlignment = 'Right'
  571. ammonution2.Text = ('| '):rep(ammo)
  572. ammonution2.FontSize = 'Size18'
  573.  
  574. local rel = Instance.new('TextButton', scrgui)
  575. rel.Size = UDim2.new(0,500,0,250)
  576. rel.Position = UDim2.new(.5, -250, .8, -250)
  577. rel.BackgroundTransparency = 1
  578. rel.TextColor3 = Color3.new(.7,0,0)
  579. rel.Visible = false
  580. rel.Text = 'Reload (r)'
  581. rel.FontSize = 'Size24'
  582.  
  583. rel.MouseButton1Down:connect(function()
  584. if ammo >= 14 or firing then return end
  585. dontclerpneck = true
  586. firing = true
  587. local dropammo = gun.Handle:clone()
  588. dropammo:ClearAllChildren()
  589. dropammo.CanCollide = true
  590. dropammo.BrickColor = BrickColor.Black()
  591. dropammo.Parent = workspace
  592. dropammo.CFrame = gun.Handle.CFrame
  593. local dropammo2 = dropammo:clone()
  594. dropammo2.Parent = workspace
  595. dropammo2.CFrame = gun2.Handle.CFrame * CFrame.new(0, -.5, 0)
  596. game:service'Debris':AddItem(dropammo,15)
  597. game:service'Debris':AddItem(dropammo2,15)
  598. wait(.5)
  599. reload:play()
  600. for i = 1, 65 do
  601. firing = true
  602. rscf = rsc0 * CFrame.Angles(math.pi/2, 0, 0)
  603. lscf = lsc0 * CFrame.new(1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, math.rad(30), math.pi/3.2)
  604. lm.C0 = clerp(lm.C0,lscf,speed)
  605. rm.C0 = clerp(rm.C0,rscf,speed)
  606. game:service'RunService'.RenderStepped:wait()
  607. end
  608. reload:play()
  609. for i = 1, 65 do
  610. firing = true
  611. rscf = rsc0 * CFrame.new(-1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, -math.rad(30), -math.pi/3.2)
  612. lscf = lsc0 * CFrame.Angles(math.pi/2, 0, 0)
  613. lm.C0 = clerp(lm.C0,lscf,speed)
  614. rm.C0 = clerp(rm.C0,rscf,speed)
  615. game:service'RunService'.RenderStepped:wait()
  616. end
  617. dontclerpneck = false
  618. firing = false
  619. ammo = 14
  620. ammonution.Text = ('| '):rep(ammo)
  621. end)
  622. tool.Selected:connect(function(mouse)
  623. Equipped = true
  624. bodygyro.Parent = torso
  625. bodygyro.cframe = torso.CFrame
  626. rs.Parent = nil
  627. ls.Parent = nil
  628. rm.Parent = torso
  629. lm.Parent = torso
  630. neck.C0 = CFrame.new(0, 1, 0)
  631. neck.C1 = CFrame.new(0, -0.5, 0)
  632. gunweld.Part0 = gun.Handle
  633. gunweld2.Part0 = gun2.Handle
  634. gunweld.Part1 = ra
  635. gunweld2.Part1 = la
  636. gunweld.C1 = CFrame.new(0, -.8, 0)
  637. gunweld.C0 = CFrame.Angles(math.pi/2-math.rad(15), 0, math.pi)
  638. gunweld2.C1 = CFrame.new(0, -.8, 0)
  639. gunweld2.C0 = CFrame.Angles(math.pi/2-math.rad(15), 0, math.pi)
  640. mouse.KeyDown:connect(function(k)
  641. if k == "r" then
  642. if ammo >= 14 or firing then return end
  643. dontclerpneck = true
  644. firing = true
  645. local dropammo = gun.Handle:clone()
  646. dropammo:ClearAllChildren()
  647. dropammo.CanCollide = true
  648. dropammo.BrickColor = BrickColor.Black()
  649. dropammo.Parent = workspace
  650. dropammo.CFrame = gun.Handle.CFrame
  651. local dropammo2 = dropammo:clone()
  652. dropammo2.Parent = workspace
  653. dropammo2.CFrame = gun2.Handle.CFrame * CFrame.new(0, -.5, 0)
  654. game:service'Debris':AddItem(dropammo,15)
  655. game:service'Debris':AddItem(dropammo2,15)
  656. wait(.5)
  657. reload:play()
  658. for i = 1, 65 do
  659. firing = true
  660. rscf = rsc0 * CFrame.Angles(math.pi/2, 0, 0)
  661. lscf = lsc0 * CFrame.new(1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, math.rad(30), math.pi/3.2)
  662. lm.C0 = clerp(lm.C0,lscf,speed)
  663. rm.C0 = clerp(rm.C0,rscf,speed)
  664. game:service'RunService'.RenderStepped:wait()
  665. end
  666. reload:play()
  667. for i = 1, 65 do
  668. firing = true
  669. rscf = rsc0 * CFrame.new(-1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, -math.rad(30), -math.pi/3.2)
  670. lscf = lsc0 * CFrame.Angles(math.pi/2, 0, 0)
  671. lm.C0 = clerp(lm.C0,lscf,speed)
  672. rm.C0 = clerp(rm.C0,rscf,speed)
  673. game:service'RunService'.RenderStepped:wait()
  674. end
  675. dontclerpneck = false
  676. firing = false
  677. ammo = 14
  678. ammonution.Text = ('| '):rep(ammo)
  679. end
  680. if k == "f" then
  681. light = not light
  682. local sound = Instance.new('Sound', head)
  683. sound.SoundId = "rbxassetid://198914875"
  684. sound.Volume = 2
  685. sound:play()
  686. game:service'Debris':AddItem(sound,1)
  687. end
  688. end)
  689. mouse.Button1Down:connect(function()
  690. if ammo <= 0 then
  691. local sound = Instance.new('Sound', head)
  692. sound.SoundId = "rbxassetid://154255000"
  693. sound.Volume = 2
  694. sound:play()
  695. game:service'Debris':AddItem(sound,1)
  696. end
  697. if firing or ammo <= 0 then return end
  698. ammo = ammo - 1
  699. ammonution.Text = ('| '):rep(ammo)
  700. firing = true
  701. local pa = Instance.new('Part')
  702. pa.CanCollide = false
  703. pa.Anchored = true
  704. pa.Locked = true
  705. pa.FormFactor = 'Custom'
  706. pa.BrickColor = BrickColor.new('New Yeller')
  707. pa.Size = Vector3.new(.2,3,.2)
  708. Instance.new('BlockMesh', pa).Scale = Vector3.new(.2,3,.2)
  709. local thegun
  710. if pistol == 1 then
  711. thegun = gun.BulletCase
  712. elseif pistol == 2 then
  713. thegun = gun2.BulletCase
  714. end
  715. local muzzle = Instance.new('PointLight', thegun)
  716. muzzle.Range = 12
  717. muzzle.Color = Color3.new(1,.6,.1)
  718. game:service'Debris':AddItem(muzzle, .05)
  719. local shell = pa:clone()
  720. shell:ClearAllChildren()
  721. shell.Anchored = false
  722. shell.CFrame = thegun.Parent.ShellCaseSpawner.CFrame
  723. shell.Size = Vector3.new(.1,.19,.1)
  724. shell.Parent = workspace
  725. shell.BrickColor = BrickColor.new('Bright yellow')
  726. shell.CanCollide = true
  727. game:service'Debris':AddItem(shell, 5)
  728. local bulletpos = thegun.Position
  729. local bulletvelocity = (mouse.Hit.p - bulletpos).unit*15
  730. local lastbulletpos = thegun.Position
  731. fire:play()
  732. coroutine.wrap(function()
  733. while game:service'RunService'.Stepped:wait() do
  734. lastbulletpos = bulletpos
  735. bulletpos = bulletpos + bulletvelocity
  736. local RayCast = Ray.new(lastbulletpos, (bulletpos - lastbulletpos))
  737. local hit, hitpos = workspace:FindPartOnRay(RayCast, char)
  738. if (torso.Position - pa.Position).magnitude > 800 then
  739. pa:Destroy()
  740. break
  741. end
  742. pa.Anchored = true
  743. pa.CFrame = CFrame.new(bulletpos, bulletpos+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0)
  744. if hit then
  745. local damage
  746. local sound = Instance.new('Sound', pa)
  747. sound.SoundId = "rbxassetid://144884872"
  748. sound.Pitch = 1.2+math.random()/3
  749. sound.Volume = 2
  750. sound:play()
  751. pa:Destroy()
  752. game:service'Debris':AddItem(sound,4)
  753. local ray = Ray.new(rootpart.Position, Vector3.new(0, -6, 0))
  754. local hitz, enz = workspace:FindPartOnRay(ray, char)
  755. local hum = hit and hit.Parent and hit.Parent:findFirstChild'Humanoid'
  756. if hum then
  757. damage = math.random(55)
  758. hum:TakeDamage(damage)
  759. end
  760. local hum = hit and hit.Parent and hit.Parent.Parent and hit.Parent.Parent:findFirstChild'Humanoid'
  761. if hum then
  762. damage = math.random(55)
  763. hum:TakeDamage(damage)
  764. end
  765. break
  766. end
  767. pa.Anchored = true
  768. pa.Parent = char
  769. pa.CFrame = CFrame.new(bulletpos, bulletpos+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0)
  770. end
  771. end)()
  772.  
  773. if pistol == 1 then
  774. pistol = 2
  775. for i = 1, 4 do
  776. rscf = CFrame.new(Vector3.new(rsc0.x, rsc0.y, rsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.new(0, 0, .5) * CFrame.Angles(math.pi/1.5 + math.sin(angle)*math.random()/20, 0, math.cos(angle)*math.random()/20)
  777. lscf = CFrame.new(Vector3.new(lsc0.x, lsc0.y, lsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, -math.cos(angle)*math.random()/20)
  778. lm.C0 = clerp(lm.C0,lscf,speed)
  779. rm.C0 = clerp(rm.C0,rscf,speed)
  780. game:service'RunService'.RenderStepped:wait()
  781. end
  782. elseif pistol == 2 then
  783. for i = 1, 4 do
  784. rscf = CFrame.new(Vector3.new(rsc0.x, rsc0.y, rsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, math.cos(angle)*math.random()/20)
  785. lscf = CFrame.new(Vector3.new(lsc0.x, lsc0.y, lsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.new(0, 0, .5) * CFrame.Angles(math.pi/1.5 + math.sin(angle)*math.random()/20, 0, -math.cos(angle)*math.random()/20)
  786. lm.C0 = clerp(lm.C0,lscf,speed)
  787. rm.C0 = clerp(rm.C0,rscf,speed)
  788. game:service'RunService'.RenderStepped:wait()
  789. end
  790. pistol = 1
  791. end
  792. firing = false
  793. end)
  794. end)
  795. tool.Deselected:connect(function()
  796. Equipped = false
  797. rm.Parent = nil
  798. lm.Parent = nil
  799. rs.Parent = torso
  800. ls.Parent = torso
  801. neck.C0 = origneckc0
  802. neck.C1 = origneckc1
  803. lm.C0 = lsc0
  804. rm.C0 = rsc0
  805. gunweld.Part0 = gun.BulletCase
  806. gunweld.Part1 = holsters.HolsterWeldTo
  807. gunweld.C0 = CFrame.new()
  808. gunweld.C1 = CFrame.new()
  809. gunweld2.Part0 = gun2.BulletCase
  810. gunweld2.Part1 = holsters.HolsterWeldTo2
  811. gunweld2.C0 = CFrame.new()
  812. gunweld2.C1 = CFrame.new()
  813. bodygyro.Parent = nil
  814. end)
  815.  
  816. game:service'RunService'.RenderStepped:connect(function()
  817. if Equipped then
  818. if ammo <= 0 then
  819. rel.Visible = true
  820. else
  821. rel.Visible = false
  822. end
  823. if light then
  824. gunlight.Enabled = true
  825. gunlight2.Enabled = true
  826. else
  827. gunlight.Enabled = false
  828. gunlight2.Enabled = false
  829. end
  830. angle = angle + (0.05+math.random()/20)
  831. local rscf = rsc0
  832. local lscf = lsc0
  833. local ncf = neckc0
  834. local rmx,rmy,rmz = rm.C0:toEulerAnglesXYZ()
  835. if rmz >= 1 then
  836. bodygyro.cframe = bodygyro.cframe * CFrame.Angles(0, -rmz/5, 0)
  837. elseif rmz <= -1 then
  838. bodygyro.cframe = bodygyro.cframe * CFrame.Angles(0, -rmz/5, 0)
  839. end
  840. rscf = CFrame.new(Vector3.new(rsc0.x, rsc0.y, rsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, math.cos(angle)*math.random()/20)
  841. lscf = CFrame.new(Vector3.new(lsc0.x, lsc0.y, lsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, -math.cos(angle)*math.random()/20)
  842. ncf = neckc0 * CFrame.new(Vector3.new(), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p))
  843. if not firing then
  844. lm.C0 = clerp(lm.C0,lscf,speed)
  845. rm.C0 = clerp(rm.C0,rscf,speed)
  846. end
  847. if not dontclerpneck then
  848. neck.C0 = clerp(neck.C0,ncf,speed)
  849. end
  850. end
  851. if light and not Equipped then
  852. gunlight.Enabled = false
  853. gunlight2.Enabled = false
  854. end
  855. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement