Advertisement
Migas3456

John Doe Shooter Script

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