Advertisement
Servbot

Untitled

Feb 11th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 77.56 KB | None | 0 0
  1. --[[
  2. Accuracy International Arctic Warfare Magnum Sniper Rifle. Designed by Accuracy International
  3. to be an accurate, powerful bolt-action sniper rifle that could function perfectly in
  4. even the most extreme environments.
  5. .338 Lapua Magnum, 5 round single-stack box magazine.
  6. --]]
  7.  
  8.  
  9. if script == nil then return end
  10.  
  11.  
  12. Player = game:GetService("Players").LocalPlayer
  13. Char = Player.Character
  14. animate = Char:findFirstChild("Animate")
  15. if animate then
  16. animate:Destroy()
  17. end
  18. Name = "Overkill"
  19. MC = BrickColor.new("Really black")
  20. DC = BrickColor.new("Really black")
  21. GC = BrickColor.new("Earth green")
  22. WC = BrickColor.new("Earth green")
  23. BC = BrickColor.new("Really black")
  24. Raycast = false
  25. Ghillie = true
  26. WSPenalty = 12
  27. Bipod = true
  28. Chambered = false
  29. MR = 0
  30. GR = 0
  31. selected = false
  32. canDual = false
  33. dual = false
  34. Button1Down = false
  35. damage = 55
  36. canFire = true
  37. canFire2 = false
  38. readyTime = 1.8
  39. automatic = false
  40. burst = false
  41. burstCount = 0
  42. burstCountMax = 2
  43. canSilence = true
  44. silenced = false
  45. canZoom = true
  46. zoom = false
  47. switchToSingle = false
  48. switchToBurst = false
  49. switchToAutomatic = false
  50.  
  51.  
  52. ammoGui = Instance.new("ScreenGui")
  53. ammoGui.Name = Name
  54. local frame = Instance.new("Frame")
  55. frame.Name = "Frame"
  56. frame.Size = UDim2.new(0, 165, 0, 60)
  57. frame.Position = UDim2.new(0, 0, 1, -400)
  58. frame.BackgroundColor3 = Color3.new(1, 1, 1)
  59. frame.BorderColor3 = Color3.new(0, 0, 0)
  60. frame.Parent = ammoGui
  61. local label = Instance.new("TextLabel")
  62. label.Name = "Weapon"
  63. label.Text = "Weapon: " ..Name
  64. label.Size = UDim2.new(1, 0, 0, 20)
  65. label.Position = UDim2.new(0, 0, 0, 0)
  66. label.BackgroundColor3 = Color3.new(1, 0, 0)
  67. label.BorderColor3 = Color3.new(0, 0, 0)
  68. label.Parent = frame
  69. local label = Instance.new("TextLabel")
  70. label.Name = "MagazinePrefix"
  71. label.Text = " Magazine:"
  72. label.TextXAlignment = "Left"
  73. label.Size = UDim2.new(1, 0, 0, 20)
  74. label.Position = UDim2.new(0, 0, 0, 20)
  75. label.BackgroundColor3 = Color3.new(1, 1, 1)
  76. label.BorderColor3 = Color3.new(0, 0, 0)
  77. label.Parent = frame
  78. local label = Instance.new("TextLabel")
  79. label.Name = "Magazine"
  80. label.Text = "0/0"
  81. label.TextXAlignment = "Right"
  82. label.Size = UDim2.new(1, 0, 0, 20)
  83. label.Position = UDim2.new(0, -10, 0, 20)
  84. label.BackgroundTransparency = 1
  85. label.BorderSizePixel = 0
  86. label.Parent = frame
  87. local label = Instance.new("TextLabel")
  88. label.Name = "AmmoPrefix"
  89. label.Text = " 8.6x70mm:"
  90. label.TextXAlignment = "Left"
  91. label.Size = UDim2.new(1, 0, 0, 20)
  92. label.Position = UDim2.new(0, 0, 0, 40)
  93. label.BackgroundColor3 = Color3.new(1, 1, 1)
  94. label.BorderColor3 = Color3.new(0, 0, 0)
  95. label.Parent = frame
  96. local label = Instance.new("TextLabel")
  97. label.Name = "Ammo"
  98. label.Text = "0/0"
  99. label.TextXAlignment = "Right"
  100. label.Size = UDim2.new(1, 0, 0, 20)
  101. label.Position = UDim2.new(0, -10, 0, 40)
  102. label.BackgroundTransparency = 1
  103. label.BorderSizePixel = 0
  104. label.Parent = frame
  105.  
  106.  
  107. function updateGui()
  108. if selected == false then return end
  109. if Player:FindFirstChild("PlayerGui") == nil then Instance.new("PlayerGui").Parent = Player end
  110. if Player.PlayerGui:FindFirstChild(Name) == nil then
  111. ammoGui:Clone().Parent = Player.PlayerGui
  112. end
  113. Player.PlayerGui[Name].Frame.Magazine.Text = tostring(magazine.Value).. "/" ..tostring(magazineMax.Value)
  114. Player.PlayerGui[Name].Frame.Ammo.Text = tostring(ammo.Value).. "/" ..tostring(ammoMax.Value)
  115. end
  116.  
  117.  
  118. function makeParts(format)
  119. local model = Instance.new("Model")
  120. model.Name = Name
  121. local pm = Instance.new("Part")
  122. pm.Material = "Grass"
  123. pm.Name = "Handle"
  124. pm.formFactor = "Symmetric"
  125. pm.Size = Vector3.new(1, 1, 1)
  126. pm.BrickColor = GC
  127. pm.Reflectance = GR
  128. pm.CanCollide = false
  129. pm.Transparency = 1
  130. pm.Locked = true
  131. pm.TopSurface = 0
  132. pm.BottomSurface = 0
  133. pm.Parent = model
  134. local m = Instance.new("BlockMesh")
  135. m.Scale = Vector3.new(0.28, 1.1, 0.19)
  136. m.Offset = Vector3.new(0, -0.25, 0.07)
  137. m.Parent = pm
  138. if format ~= nil then
  139. local w = Instance.new("Weld")
  140. w.Part0 = pm
  141. if format == "RightHand" then
  142. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  143. w.C0 = CFrame.new(0, 1.15, 0.7)
  144. w.C1 = CFrame.new()
  145. elseif format == "RightHolster" then
  146. w.Part1 = Player.Character:FindFirstChild("Torso")
  147. w.C0 = CFrame.new(0.65, -0.85, 0.4) * CFrame.fromEulerAnglesXYZ(math.rad(32), math.rad(-90), 0)
  148. w.C1 = CFrame.new()
  149. model.Name = Name.. " (Holstered)"
  150. end
  151. w.Parent = pm
  152. model.Parent = Player.Character
  153. end
  154. --[[
  155. sniper1 http://www.roblox.com/asset/?id=1868836
  156. equip http://www.roblox.com/asset/?id=13510737
  157. fire1 http://www.roblox.com/asset/?id=2760979
  158. fire2 http://www.roblox.com/asset/?id=13510352
  159. fire3 http://www.roblox.com/asset/?id=2692806
  160. fire4 http://www.roblox.com/asset/?id=2691586 possible
  161. fire5 http://www.roblox.com/asset/?id=2920959
  162. fire6 http://www.roblox.com/asset/?id=2697431
  163. fire7 http://www.roblox.com/asset/?id=2920959
  164. reload1 http://www.roblox.com/asset/?id=2691591
  165. reload2 http://www.roblox.com/asset/?id=2697432
  166. reload3 http://www.roblox.com/asset/?id=2920960
  167. reload4 http://www.roblox.com/asset/?id=2761842
  168. shotgun1 http://www.roblox.com/asset/?id=2697294
  169. --]]
  170. local s = Instance.new("Sound")
  171. s.Name = "Fire"
  172. s.SoundId = "http://www.roblox.com/Asset/?id=132572951"
  173. s.Volume = 0.4
  174. s.Pitch = 1
  175. s.Looped = false
  176. s.Parent = pm
  177. local s = Instance.new("Sound")
  178. s.Name = "Fire2"
  179. s.SoundId = "http://roblox.com/asset/?id=2691586"
  180. s.Volume = 1
  181. s.Pitch = 1.4
  182. s.Looped = false
  183. s.Parent = pm
  184. local s = Instance.new("Sound")
  185. s.Name = "Equip"
  186. s.SoundId = "http://www.roblox.com/asset/?id=10209881"
  187. s.Volume = 1
  188. s.Pitch = 0.6
  189. s.Looped = false
  190. s.Parent = pm
  191. local s = Instance.new("Sound")
  192. s.Name = "Release"
  193. s.SoundId = "http://www.roblox.com/Asset/?id=10209813"
  194. s.Volume = 1
  195. s.Pitch = 3
  196. s.Looped = false
  197. s.Parent = pm
  198. local s = Instance.new("Sound")
  199. s.Name = "Reload"
  200. s.SoundId = "http://www.roblox.com/Asset/?id=10209845"
  201. s.Volume = 1
  202. s.Pitch = 8
  203. s.Looped = false
  204. s.Parent = pm
  205. local s = Instance.new("Sound")
  206. s.Name = "Action2"
  207. s.SoundId = "http://www.roblox.com/Asset/?id=2697295"
  208. s.Volume = 1
  209. s.Pitch = 1
  210. s.Looped = false
  211. s.Parent = pm
  212. local s = Instance.new("Sound")
  213. s.Name = "Action1"
  214. s.SoundId = "http://www.roblox.com/Asset/?id=10209834"
  215. s.Volume = 0.7
  216. s.Pitch = 1.5
  217. s.Looped = false
  218. s.Parent = pm
  219. local s = Instance.new("Sound")
  220. s.Name = "Action3"
  221. s.SoundId = "http://www.roblox.com/Asset/?id=10209845"
  222. s.Volume = 0.6
  223. s.Pitch = 2.5
  224. s.Looped = false
  225. s.Parent = pm
  226. local s = Instance.new("Sound")
  227. s.Name = "Empty"
  228. s.SoundId = "http://www.roblox.com/asset/?id=2697295"
  229. s.Volume = 1
  230. s.Pitch = 5
  231. s.Looped = false
  232. s.Parent = pm
  233. local s = Instance.new("Sound")
  234. s.Name = "Switch"
  235. s.SoundId = "http://www.roblox.com/asset/?id=2697295"
  236. s.Volume = 1
  237. s.Pitch = 10
  238. s.Looped = false
  239. s.Parent = pm
  240. local s = Instance.new("Sound")
  241. s.Name = "Bullet"
  242. s.SoundId = "http://www.roblox.com/Asset/?id=18426149"
  243. s.Volume = 1
  244. s.Pitch = 1
  245. s.Looped = false
  246. s.Parent = pm
  247. local s = Instance.new("Sound")
  248. s.Name = "Jam"
  249. s.SoundId = "http://www.roblox.com/Asset/?id=10209636"
  250. s.Volume = 1
  251. s.Pitch = 2
  252. s.Looped = false
  253. s.Parent = pm
  254. local p = Instance.new("Part")
  255. p.Material = "SmoothPlastic"
  256. p.Name = "ShellOut"
  257. p.formFactor = "Custom"
  258. p.Size = Vector3.new(0.2, 0.2, 0.2)
  259. p.Transparency = 1
  260. p.Locked = true
  261. p.CanCollide = false
  262. p.TopSurface = 0
  263. p.BottomSurface = 0
  264. p.Parent = model
  265. local w = Instance.new("Weld")
  266. w.Part0 = p
  267. w.Part1 = pm
  268. w.C0 = CFrame.new(-0.06, 0.62, -0.06) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  269. w.C1 = CFrame.new()
  270. w.Parent = p--]]
  271. local p = Instance.new("Part")
  272. p.Material = "Grass"
  273. p.Name = "Grip"
  274. p.formFactor = "Symmetric"
  275. p.Size = Vector3.new(1, 1, 1)
  276. p.BrickColor = GC
  277. p.Reflectance = GR
  278. p.CanCollide = false
  279. p.Locked = true
  280. p.TopSurface = 0
  281. p.BottomSurface = 0
  282. p.Parent = model
  283. local m = Instance.new("BlockMesh")
  284. m.Scale = Vector3.new(0.3, 0.38, 0.8)
  285. m.Parent = p
  286. local w = Instance.new("Weld")
  287. w.Part0 = p
  288. w.Part1 = pm
  289. w.C0 = CFrame.new(0, -0.15, -0.46) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
  290. w.C1 = CFrame.new()
  291. w.Parent = p
  292. local p = Instance.new("Part")
  293. p.Material = "SmoothPlastic"
  294. p.Name = "Magazine"
  295. p.formFactor = "Symmetric"
  296. p.Size = Vector3.new(1, 1, 1)
  297. p.BrickColor = DC
  298. p.Reflectance = MR
  299. p.CanCollide = false
  300. p.Locked = true
  301. p.TopSurface = 0
  302. p.BottomSurface = 0
  303. p.Parent = model
  304. local m = Instance.new("BlockMesh")
  305. m.Scale = Vector3.new(0.2, 0.5, 0.5)
  306. m.Parent = p
  307. local w = Instance.new("Weld")
  308. w.Part0 = p
  309. w.Part1 = pm
  310. w.C0 = CFrame.new(0, 0.5, -0.24)
  311. w.C1 = CFrame.new()
  312. w.Parent = p
  313. local p = Instance.new("Part")
  314. p.Material = "SmoothPlastic"
  315. p.Name = "Trigger Housing"
  316. p.formFactor = "Symmetric"
  317. p.Size = Vector3.new(1, 1, 1)
  318. p.BrickColor = MC
  319. p.Reflectance = MR
  320. p.CanCollide = false
  321. p.Locked = true
  322. p.TopSurface = 0
  323. p.BottomSurface = 0
  324. p.Parent = model
  325. local m = Instance.new("BlockMesh")
  326. m.Scale = Vector3.new(0.2, 0.4, 0.04)
  327. m.Parent = p
  328. local w = Instance.new("Weld")
  329. w.Part0 = p
  330. w.Part1 = pm
  331. w.C0 = CFrame.new(0, 0.1, -0.36)
  332. w.C1 = CFrame.new()
  333. w.Parent = p
  334. local p = Instance.new("Part")
  335. p.Material = "SmoothPlastic"
  336. p.Name = "Trigger"
  337. p.formFactor = "Symmetric"
  338. p.Size = Vector3.new(1, 1, 1)
  339. p.BrickColor = BrickColor.new("Dark stone grey")
  340. p.Reflectance = MR
  341. p.CanCollide = false
  342. p.Locked = true
  343. p.TopSurface = 0
  344. p.BottomSurface = 0
  345. p.Parent = model
  346. local m = Instance.new("BlockMesh")
  347. m.Scale = Vector3.new(0.18, 0.18, 0.18)
  348. m.Parent = p
  349. local w = Instance.new("Weld")
  350. w.Part0 = p
  351. w.Part1 = pm
  352. w.C0 = CFrame.new(0, 0.02, -0.25)
  353. w.C1 = CFrame.new()
  354. w.Parent = p
  355. local p = Instance.new("Part")
  356. p.Material = "Grass"
  357. p.Name = "Body1" --------------
  358. p.CanCollide = false
  359. p.formFactor = "Symmetric"
  360. p.Size = Vector3.new(1, 1, 1)
  361. p.BrickColor = GC
  362. p.Reflectance = GR
  363. p.Locked = true
  364. p.TopSurface = 0
  365. p.BottomSurface = 0
  366. p.Parent = model
  367. local m = Instance.new("BlockMesh")
  368. m.Scale = Vector3.new(0.3, 0.6, 0.38)
  369. m.Parent = p
  370. local w = Instance.new("Weld")
  371. w.Part0 = p
  372. w.Part1 = pm
  373. w.C0 = CFrame.new(0, 0.5, -0.12)
  374. w.C1 = CFrame.new()
  375. w.Parent = p
  376. local p = Instance.new("Part")
  377. p.Material = "Grass"
  378. p.Name = "Body3" --------------
  379. p.CanCollide = false
  380. p.formFactor = "Symmetric"
  381. p.Size = Vector3.new(1, 1, 1)
  382. p.BrickColor = GC
  383. p.Reflectance = GR
  384. p.Locked = true
  385. p.TopSurface = 0
  386. p.BottomSurface = 0
  387. p.Parent = model
  388. local m = Instance.new("BlockMesh")
  389. m.Scale = Vector3.new(0.3, 1.4, 0.32)
  390. m.Parent = p
  391. local w = Instance.new("Weld")
  392. w.Part0 = p
  393. w.Part1 = pm
  394. w.C0 = CFrame.new(0, 1.5, -0.09)
  395. w.C1 = CFrame.new()
  396. w.Parent = p
  397. local p = Instance.new("Part")
  398. p.Material = "SmoothPlastic"
  399. p.Name = "Body2"
  400. p.CanCollide = false
  401. p.formFactor = "Symmetric"
  402. p.Size = Vector3.new(1, 1, 1)
  403. p.BrickColor = DC
  404. p.Reflectance = MR
  405. p.Locked = true
  406. p.TopSurface = 0
  407. p.BottomSurface = 0
  408. p.Parent = model
  409. local m = Instance.new("SpecialMesh")
  410. m.MeshType = "Brick"
  411. m.Scale = Vector3.new(0.32, 1.4, 0.2)
  412. m.Parent = p
  413. local w = Instance.new("Weld")
  414. w.Part0 = p
  415. w.Part1 = pm
  416. w.C0 = CFrame.new(0, 1.48, -0.08)
  417. w.C1 = CFrame.new()
  418. w.Parent = p
  419. local p = Instance.new("Part")
  420. p.Material = "Grass"
  421. p.Name = "GripAngle1"
  422. p.CanCollide = false
  423. p.formFactor = "Symmetric"
  424. p.Size = Vector3.new(1, 1, 1)
  425. p.BrickColor = GC
  426. p.Reflectance = GR
  427. p.Locked = true
  428. p.TopSurface = 0
  429. p.BottomSurface = 0
  430. p.Parent = model
  431. local m = Instance.new("SpecialMesh")
  432. m.MeshType = "Wedge"
  433. m.Scale = Vector3.new(0.3, 0.14, 0.6)
  434. m.Parent = p
  435. local w = Instance.new("Weld")
  436. w.Part0 = p
  437. w.Part1 = pm
  438. w.C0 = CFrame.new(0, -0.38, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180))
  439. w.C1 = CFrame.new()
  440. w.Parent = p
  441. local p = Instance.new("Part")
  442. p.Material = "SmoothPlastic"
  443. p.Material = "Grass"
  444. p.Name = "GripAngle2"
  445. p.CanCollide = false
  446. p.formFactor = "Symmetric"
  447. p.Size = Vector3.new(1, 1, 1)
  448. p.BrickColor = GC
  449. p.Reflectance = GR
  450. p.Locked = true
  451. p.TopSurface = 0
  452. p.BottomSurface = 0
  453. p.Parent = model
  454. local m = Instance.new("SpecialMesh")
  455. m.MeshType = "Wedge"
  456. m.Scale = Vector3.new(0.3, 0.38, 0.7)
  457. m.Parent = p
  458. local w = Instance.new("Weld")
  459. w.Part0 = p
  460. w.Part1 = pm
  461. w.C0 = CFrame.new(0, -0.12, 1.14) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180))
  462. w.C1 = CFrame.new()
  463. w.Parent = p
  464. local p = Instance.new("Part")
  465. p.Material = "Grass"
  466. p.Name = "GripTrigHous"
  467. p.formFactor = "Symmetric"
  468. p.Size = Vector3.new(1, 1, 1)
  469. p.BrickColor = GC
  470. p.Reflectance = GR
  471. p.CanCollide = false
  472. p.Locked = true
  473. p.TopSurface = 0
  474. p.BottomSurface = 0
  475. p.Parent = model
  476. local m = Instance.new("BlockMesh")
  477. m.Scale = Vector3.new(0.3, 0.4, 0.1)
  478. m.Parent = p
  479. local w = Instance.new("Weld")
  480. w.Part0 = p
  481. w.Part1 = pm
  482. w.C0 = CFrame.new(0, 0, -0.4)
  483. w.C1 = CFrame.new()
  484. w.Parent = p
  485. local p = Instance.new("Part")
  486. p.Material = "Grass"
  487. p.Name = "GripCover"
  488. p.formFactor = "Symmetric"
  489. p.Size = Vector3.new(1, 1, 1)
  490. p.BrickColor = GC
  491. p.Reflectance = GR
  492. p.CanCollide = false
  493. p.Locked = true
  494. p.TopSurface = 0
  495. p.BottomSurface = 0
  496. p.Parent = model
  497. local m = Instance.new("BlockMesh")
  498. m.Scale = Vector3.new(0.3, 1, 0.3)
  499. m.Parent = p
  500. local w = Instance.new("Weld")
  501. w.Part0 = p
  502. w.Part1 = pm
  503. w.C0 = CFrame.new(0, 0.35, -0.08)
  504. w.C1 = CFrame.new()
  505. w.Parent = p
  506. local p = Instance.new("Part")
  507. p.Material = "SmoothPlastic"
  508. p.Name = "BoltBlock" --------------
  509. p.CanCollide = false
  510. p.formFactor = "Symmetric"
  511. p.Size = Vector3.new(1, 1, 1)
  512. p.BrickColor = DC
  513. p.Reflectance = MR
  514. p.Locked = true
  515. p.TopSurface = 0
  516. p.BottomSurface = 0
  517. p.Parent = model
  518. local m = Instance.new("SpecialMesh")
  519. m.MeshType = "Brick"
  520. m.Scale = Vector3.new(0.28, 1.2, 0.3)
  521. m.Parent = p
  522. local w = Instance.new("Weld")
  523. w.Part0 = p
  524. w.Part1 = pm
  525. w.C0 = CFrame.new(0, 0.35, 0.06)
  526. w.C1 = CFrame.new()
  527. w.Parent = p
  528. local pb = Instance.new("Part")
  529. pb.Material = "SmoothPlastic"
  530. pb.Name = "Bolt"
  531. pb.formFactor = "Symmetric"
  532. pb.Size = Vector3.new(1, 1, 1)
  533. pb.BrickColor = BC
  534. pb.Reflectance = MR
  535. pb.Transparency = 0
  536. pb.CanCollide = false
  537. pb.Locked = true
  538. pb.TopSurface = 0
  539. pb.BottomSurface = 0
  540. pb.Parent = model
  541. local m = Instance.new("SpecialMesh")
  542. m.MeshType = "Brick"
  543. m.Scale = Vector3.new(0.26, 0.26, 0.26)
  544. m.Parent = pb
  545. local w = Instance.new("Weld")
  546. w.Part0 = pb
  547. w.Part1 = pm
  548. w.C0 = CFrame.new(0, -0.2, 0.06)
  549. w.C1 = CFrame.new()
  550. w.Parent = pb
  551. local p = Instance.new("Part")
  552. p.Material = "SmoothPlastic"
  553. p.Name = "Bolt 1"
  554. p.formFactor = "Symmetric"
  555. p.Size = Vector3.new(1, 1, 1)
  556. p.BrickColor = BC
  557. p.Reflectance = MR
  558. p.CanCollide = false
  559. p.Locked = true
  560. p.TopSurface = 0
  561. p.BottomSurface = 0
  562. p.Parent = model
  563. local m = Instance.new("CylinderMesh")
  564. m.Scale = Vector3.new(0.16, 0.6, 0.16)
  565. m.Parent = p
  566. local w = Instance.new("Weld")
  567. w.Part0 = p
  568. w.Part1 = pb
  569. w.C0 = CFrame.new(0, 0.28, 0)
  570. w.C1 = CFrame.new()
  571. w.Parent = p
  572. local pbb = Instance.new("Part")
  573. pbb.Material = "SmoothPlastic"
  574. pbb.Name = "BoltKnob"
  575. pbb.formFactor = "Symmetric"
  576. pbb.Size = Vector3.new(1, 1, 1)
  577. pbb.BrickColor = BC
  578. pbb.Reflectance = MR
  579. pbb.CanCollide = false
  580. pbb.Locked = true
  581. pbb.TopSurface = 0
  582. pbb.BottomSurface = 0
  583. pbb.Parent = model
  584. local m = Instance.new("BlockMesh")
  585. m.Scale = Vector3.new(0.2, 0.08, 0.08)
  586. m.Parent = pbb
  587. local w = Instance.new("Weld")
  588. w.Part0 = pbb
  589. w.Part1 = pb
  590. w.C0 = CFrame.new(-0.2, 0, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(20), 0)
  591. w.C1 = CFrame.new()
  592. w.Parent = pbb
  593. local p = Instance.new("Part")
  594. p.Material = "SmoothPlastic"
  595. p.Name = "Bolt 2"
  596. p.formFactor = "Symmetric"
  597. p.Size = Vector3.new(1, 1, 1)
  598. p.BrickColor = BC
  599. p.Reflectance = MR
  600. p.CanCollide = false
  601. p.Locked = true
  602. p.TopSurface = 0
  603. p.BottomSurface = 0
  604. p.Parent = model
  605. local m = Instance.new("SpecialMesh")
  606. m.MeshType = "Sphere"
  607. m.Scale = Vector3.new(0.18, 0.18, 0.18)
  608. m.Parent = p
  609. local w = Instance.new("Weld")
  610. w.Part0 = p
  611. w.Part1 = pbb
  612. w.C0 = CFrame.new(-0.15, 0, 0)
  613. w.C1 = CFrame.new()
  614. w.Parent = p
  615. local p = Instance.new("Part")
  616. p.Material = "SmoothPlastic"
  617. p.Name = "Barrel 1"
  618. p.formFactor = "Symmetric"
  619. p.Size = Vector3.new(1, 1, 1)
  620. p.BrickColor = DC
  621. p.Reflectance = MR
  622. p.CanCollide = false
  623. p.Locked = true
  624. p.TopSurface = 0
  625. p.BottomSurface = 0
  626. p.Parent = model
  627. local m = Instance.new("CylinderMesh")
  628. m.Scale = Vector3.new(0.18, 3, 0.18)
  629. m.Parent = p
  630. local w = Instance.new("Weld")
  631. w.Part0 = p
  632. w.Part1 = pm
  633. w.C0 = CFrame.new(0, 2.1, 0.06)
  634. w.C1 = CFrame.new()
  635. w.Parent = p
  636. local p = Instance.new("Part")
  637. p.Material = "SmoothPlastic"
  638. p.Name = "Barrel 2"
  639. p.formFactor = "Symmetric"
  640. p.Size = Vector3.new(1, 1, 1)
  641. p.BrickColor = DC
  642. p.Reflectance = MR
  643. p.CanCollide = false
  644. p.Locked = true
  645. p.TopSurface = 0
  646. p.BottomSurface = 0
  647. p.Parent = model
  648. local m = Instance.new("BlockMesh")
  649. m.Scale = Vector3.new(0.1, 3, 0.2)
  650. m.Parent = p
  651. local w = Instance.new("Weld")
  652. w.Part0 = p
  653. w.Part1 = pm
  654. w.C0 = CFrame.new(0, 2.1, 0.06)
  655. w.C1 = CFrame.new()
  656. w.Parent = p
  657. local p = Instance.new("Part")
  658. p.Material = "SmoothPlastic"
  659. p.Name = "Barrel 3"
  660. p.formFactor = "Symmetric"
  661. p.Size = Vector3.new(1, 1, 1)
  662. p.BrickColor = DC
  663. p.Reflectance = MR
  664. p.CanCollide = false
  665. p.Locked = true
  666. p.TopSurface = 0
  667. p.BottomSurface = 0
  668. p.Parent = model
  669. local m = Instance.new("BlockMesh")
  670. m.Scale = Vector3.new(0.2, 3, 0.1)
  671. m.Parent = p
  672. local w = Instance.new("Weld")
  673. w.Part0 = p
  674. w.Part1 = pm
  675. w.C0 = CFrame.new(0, 2.1, 0.06)
  676. w.C1 = CFrame.new()
  677. w.Parent = p
  678. local p = Instance.new("Part")
  679. p.Material = "SmoothPlastic"
  680. if silenced == false then
  681. p.Name = "Muzzle"
  682. else
  683. p.Name = "Muzzle 2"
  684. end
  685. p.formFactor = "Symmetric"
  686. p.Size = Vector3.new(1, 1, 1)
  687. p.BrickColor = DC
  688. p.Reflectance = MR
  689. p.CanCollide = false
  690. p.Locked = true
  691. p.TopSurface = 0
  692. p.BottomSurface = 0
  693. p.Parent = model
  694. local m = Instance.new("CylinderMesh")
  695. m.Scale = Vector3.new(0.24, 0.8, 0.24)
  696. m.Parent = p
  697. local w = Instance.new("Weld")
  698. w.Part0 = p
  699. w.Part1 = pm
  700. w.C0 = CFrame.new(0, 3.5, 0.06)
  701. w.C1 = CFrame.new()
  702. w.Parent = p
  703. local s = Instance.new("Smoke")
  704. s.Enabled = false
  705. s.Name = "Smoke"
  706. s.RiseVelocity = -5
  707. s.Opacity = 0.5
  708. s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225)
  709. s.Size = 2.4
  710. s.Parent = p
  711. local f = Instance.new("Fire")
  712. f.Enabled = false
  713. f.Name = "Fire"
  714. f.Heat = -20
  715. f.Size = 3.6
  716. f.Parent = p
  717. local p = Instance.new("Part")
  718. p.Material = "SmoothPlastic"
  719. p.Name = "MuzzleHole"
  720. p.formFactor = "Symmetric"
  721. p.Size = Vector3.new(1, 1, 1)
  722. p.BrickColor = BrickColor.new("Really black")
  723. p.Reflectance = MR
  724. p.CanCollide = false
  725. p.Locked = true
  726. p.TopSurface = 0
  727. p.BottomSurface = 0
  728. p.Parent = model
  729. local m = Instance.new("CylinderMesh")
  730. m.Scale = Vector3.new(0.16, 0.8, 0.16)
  731. m.Parent = p
  732. local w = Instance.new("Weld")
  733. w.Part0 = p
  734. w.Part1 = pm
  735. w.C0 = CFrame.new(0, 3.504, 0.06)
  736. w.C1 = CFrame.new()
  737. w.Parent = p
  738. local p = Instance.new("Part")
  739. p.Material = "SmoothPlastic"
  740. if silenced == false then
  741. p.Name = "Silencer"
  742. p.Transparency = 1
  743. else
  744. p.Name = "Muzzle"
  745. p.Transparency = 0
  746. end
  747. p.formFactor = "Symmetric"
  748. p.Size = Vector3.new(1, 1, 1)
  749. p.BrickColor = MC
  750. p.CanCollide = false
  751. p.Locked = true
  752. p.TopSurface = 0
  753. p.BottomSurface = 0
  754. p.Parent = model
  755. local m = Instance.new("CylinderMesh")
  756. m.Scale = Vector3.new(0.26, 1, 0.26)
  757. m.Parent = p
  758. local w = Instance.new("Weld")
  759. w.Part0 = p
  760. w.Part1 = pm
  761. w.C0 = CFrame.new(0, 4, 0.06)
  762. w.C1 = CFrame.new()
  763. w.Parent = p
  764. local p = Instance.new("Part")
  765. p.Material = "Grass"
  766. p.Name = "Silencer1"
  767. p.formFactor = "Symmetric"
  768. p.Size = Vector3.new(1, 1, 1)
  769. p.BrickColor = GC
  770. p.CanCollide = false
  771. if silenced == false then
  772. p.Transparency = 1
  773. else
  774. p.Transparency = 0
  775. end
  776. p.Locked = true
  777. p.TopSurface = 0
  778. p.BottomSurface = 0
  779. p.Parent = model
  780. local m = Instance.new("CylinderMesh")
  781. m.Scale = Vector3.new(0.261, 0.6, 0.261)
  782. m.Parent = p
  783. local w = Instance.new("Weld")
  784. w.Part0 = p
  785. w.Part1 = pm
  786. w.C0 = CFrame.new(0, 4.1, 0.06)
  787. w.C1 = CFrame.new()
  788. w.Parent = p
  789. local p = Instance.new("Part")
  790. p.Material = "SmoothPlastic"
  791. p.Name = "Silencer2"
  792. p.formFactor = "Symmetric"
  793. p.Size = Vector3.new(1, 1, 1)
  794. p.BrickColor = BrickColor.new("Really black")
  795. p.CanCollide = false
  796. if silenced == false then
  797. p.Transparency = 1
  798. else
  799. p.Transparency = 0
  800. end
  801. p.Locked = true
  802. p.TopSurface = 0
  803. p.BottomSurface = 0
  804. p.Parent = model
  805. local m = Instance.new("CylinderMesh")
  806. m.Scale = Vector3.new(0.16, 1.002, 0.16)
  807. m.Parent = p
  808. local w = Instance.new("Weld")
  809. w.Part0 = p
  810. w.Part1 = pm
  811. w.C0 = CFrame.new(0, 4, 0.06)
  812. w.C1 = CFrame.new()
  813. w.Parent = p
  814. local p = Instance.new("Part")
  815. p.Material = "SmoothPlastic"
  816. p.Material = "Grass"
  817. p.Name = "GripStock"
  818. p.formFactor = "Symmetric"
  819. p.Size = Vector3.new(1, 1, 1)
  820. p.BrickColor = GC
  821. p.Reflectance = GR
  822. p.CanCollide = false
  823. p.Locked = true
  824. p.TopSurface = 0
  825. p.BottomSurface = 0
  826. p.Parent = model
  827. local m = Instance.new("BlockMesh")
  828. m.Scale = Vector3.new(0.3, 0.8, 0.3)
  829. m.Parent = p
  830. local w = Instance.new("Weld")
  831. w.Part0 = p
  832. w.Part1 = pm
  833. w.C0 = CFrame.new(0, -0.6, -0.72) * CFrame.fromEulerAnglesXYZ(math.rad(20), 0, 0)
  834. w.C1 = CFrame.new()
  835. w.Parent = p
  836. local p = Instance.new("Part") -- Standard Stock
  837. p.Material = "SmoothPlastic"
  838. p.Material = "Grass"
  839. p.Name = "StockT"
  840. p.CanCollide = false
  841. p.formFactor = "Symmetric"
  842. p.Size = Vector3.new(1, 1, 1)
  843. p.BrickColor = GC
  844. p.Reflectance = GR
  845. p.Locked = true
  846. p.TopSurface = 0
  847. p.BottomSurface = 0
  848. p.Parent = model
  849. local m = Instance.new("BlockMesh")
  850. m.Scale = Vector3.new(0.3, 1.4, 0.25)
  851. m.Parent = p
  852. local w = Instance.new("Weld")
  853. w.Part0 = p
  854. w.Part1 = pm
  855. w.C0 = CFrame.new(0, -0.6, -0.1)
  856. w.C1 = CFrame.new()
  857. w.Parent = p
  858. local p = Instance.new("Part")
  859. p.Material = "SmoothPlastic"
  860. p.Name = "CheekRest" --------------
  861. p.CanCollide = false
  862. p.formFactor = "Symmetric"
  863. p.Size = Vector3.new(1, 1, 1)
  864. p.BrickColor = DC
  865. p.Reflectance = MR
  866. p.Locked = true
  867. p.TopSurface = 0
  868. p.BottomSurface = 0
  869. p.Parent = model
  870. local m = Instance.new("SpecialMesh")
  871. m.MeshType = "Brick"
  872. m.Scale = Vector3.new(0.26, 0.6, 0.3)
  873. m.Parent = p
  874. local w = Instance.new("Weld")
  875. w.Part0 = p
  876. w.Part1 = pm
  877. w.C0 = CFrame.new(0, -0.84, -0.04)
  878. w.C1 = CFrame.new()
  879. w.Parent = p
  880. local p = Instance.new("Part")
  881. p.Material = "SmoothPlastic"
  882. p.Name = "Stock1"
  883. p.CanCollide = false
  884. p.formFactor = "Symmetric"
  885. p.Size = Vector3.new(1, 1, 1)
  886. p.BrickColor = DC
  887. p.Reflectance = MR
  888. p.Locked = true
  889. p.TopSurface = 0
  890. p.BottomSurface = 0
  891. p.Parent = model
  892. local m = Instance.new("BlockMesh")
  893. m.Scale = Vector3.new(0.34, 0.4, 0.7)
  894. m.Parent = p
  895. local w = Instance.new("Weld")
  896. w.Part0 = p
  897. w.Part1 = pm
  898. w.C0 = CFrame.new(0, -1.38, -0.3)
  899. w.C1 = CFrame.new()
  900. w.Parent = p
  901. local p = Instance.new("Part")
  902. p.Material = "Grass"
  903. p.Name = "Stock2"
  904. p.CanCollide = false
  905. p.formFactor = "Symmetric"
  906. p.Size = Vector3.new(1, 1, 1)
  907. p.BrickColor = GC
  908. p.Reflectance = GR
  909. p.Locked = true
  910. p.TopSurface = 0
  911. p.BottomSurface = 0
  912. p.Parent = model
  913. local m = Instance.new("BlockMesh")
  914. m.Scale = Vector3.new(0.3, 0.4, 0.5)
  915. m.Parent = p
  916. local w = Instance.new("Weld")
  917. w.Part0 = p
  918. w.Part1 = pm
  919. w.C0 = CFrame.new(0, -0.38, -1) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180))
  920. w.C1 = CFrame.new()
  921. w.Parent = p--]]
  922. local ps = Instance.new("Part") -- Scope
  923. ps.Material = "SmoothPlastic"
  924. ps.Name = "Scope Center 1"
  925. ps.CanCollide = false
  926. ps.formFactor = "Symmetric"
  927. ps.Size = Vector3.new(1, 1, 1)
  928. ps.BrickColor = DC
  929. ps.Reflectance = MR
  930. ps.Locked = true
  931. ps.TopSurface = 0
  932. ps.BottomSurface = 0
  933. ps.Parent = model
  934. local m = Instance.new("CylinderMesh")
  935. m.Scale = Vector3.new(0.2, 0.8, 0.2)
  936. m.Parent = ps
  937. local w = Instance.new("Weld")
  938. w.Part0 = ps
  939. w.Part1 = pm
  940. w.C0 = CFrame.new(0, 0.3, 0.38)
  941. w.C1 = CFrame.new()
  942. w.Parent = ps
  943. local p = Instance.new("Part")
  944. p.Material = "SmoothPlastic"
  945. p.Name = "Scope Knob"
  946. p.CanCollide = false
  947. p.formFactor = "Symmetric"
  948. p.Size = Vector3.new(1, 1, 1)
  949. p.BrickColor = DC
  950. p.Reflectance = MR
  951. p.Locked = true
  952. p.TopSurface = 0
  953. p.BottomSurface = 0
  954. p.Parent = model
  955. local m = Instance.new("CylinderMesh")
  956. m.Scale = Vector3.new(0.18, 0.26, 0.18)
  957. m.Parent = p
  958. local w = Instance.new("Weld")
  959. w.Part0 = p
  960. w.Part1 = ps
  961. w.C0 = CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  962. w.C1 = CFrame.new()
  963. w.Parent = p
  964. local p = Instance.new("Part")
  965. p.Material = "SmoothPlastic"
  966. p.Name = "Scope Knob2"
  967. p.CanCollide = false
  968. p.formFactor = "Symmetric"
  969. p.Size = Vector3.new(1, 1, 1)
  970. p.BrickColor = DC
  971. p.Reflectance = MR
  972. p.Locked = true
  973. p.TopSurface = 0
  974. p.BottomSurface = 0
  975. p.Parent = model
  976. local m = Instance.new("CylinderMesh")
  977. m.Scale = Vector3.new(0.16, 0.26, 0.16)
  978. m.Parent = p
  979. local w = Instance.new("Weld")
  980. w.Part0 = p
  981. w.Part1 = ps
  982. w.C0 = CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
  983. w.C1 = CFrame.new()
  984. w.Parent = p
  985. local p = Instance.new("Part")
  986. p.Material = "SmoothPlastic"
  987. p.Name = "Scope Base"
  988. p.formFactor = "Symmetric"
  989. p.CanCollide = false
  990. p.Size = Vector3.new(1, 1, 1)
  991. p.BrickColor = DC
  992. p.Reflectance = MR
  993. p.Locked = true
  994. p.TopSurface = 0
  995. p.BottomSurface = 0
  996. p.Parent = model
  997. local m = Instance.new("BlockMesh")
  998. m.Scale = Vector3.new(0.1, 0.14, 0.4)
  999. m.Parent = p
  1000. local w = Instance.new("Weld")
  1001. w.Part0 = p
  1002. w.Part1 = ps
  1003. w.C0 = CFrame.new(0, -0.2, -0.18)
  1004. w.C1 = CFrame.new()
  1005. w.Parent = p
  1006. local p = Instance.new("Part")
  1007. p.Material = "SmoothPlastic"
  1008. p.Name = "Scope Base"
  1009. p.formFactor = "Symmetric"
  1010. p.CanCollide = false
  1011. p.Size = Vector3.new(1, 1, 1)
  1012. p.BrickColor = DC
  1013. p.Reflectance = MR
  1014. p.Locked = true
  1015. p.TopSurface = 0
  1016. p.BottomSurface = 0
  1017. p.Parent = model
  1018. local m = Instance.new("BlockMesh")
  1019. m.Scale = Vector3.new(0.1, 0.14, 0.4)
  1020. m.Parent = p
  1021. local w = Instance.new("Weld")
  1022. w.Part0 = p
  1023. w.Part1 = ps
  1024. w.C0 = CFrame.new(0, 0.2, -0.18)
  1025. w.C1 = CFrame.new()
  1026. w.Parent = p
  1027. local p = Instance.new("Part")
  1028. p.Material = "SmoothPlastic"
  1029. p.Name = "Scope Back"
  1030. p.CanCollide = false
  1031. p.formFactor = "Symmetric"
  1032. p.Size = Vector3.new(1, 1, 1)
  1033. p.BrickColor = DC
  1034. p.Reflectance = MR
  1035. p.Locked = true
  1036. p.TopSurface = 0
  1037. p.BottomSurface = 0
  1038. p.Parent = model
  1039. local m = Instance.new("CylinderMesh")
  1040. m.Scale = Vector3.new(0.24, 0.375, 0.24)
  1041. m.Parent = p
  1042. local w = Instance.new("Weld")
  1043. w.Part0 = p
  1044. w.Part1 = ps
  1045. w.C0 = CFrame.new(0, -0.5, 0)
  1046. w.C1 = CFrame.new()
  1047. w.Parent = p
  1048. local p = Instance.new("Part")
  1049. p.Material = "SmoothPlastic"
  1050. p.Name = "Scope Front"
  1051. p.CanCollide = false
  1052. p.formFactor = "Symmetric"
  1053. p.Size = Vector3.new(1, 1, 1)
  1054. p.BrickColor = DC
  1055. p.Reflectance = MR
  1056. p.Locked = true
  1057. p.TopSurface = 0
  1058. p.BottomSurface = 0
  1059. p.Parent = model
  1060. local m = Instance.new("CylinderMesh")
  1061. m.Scale = Vector3.new(0.28, 0.7, 0.28)
  1062. m.Parent = p
  1063. local w = Instance.new("Weld")
  1064. w.Part0 = p
  1065. w.Part1 = ps
  1066. w.C0 = CFrame.new(0, 0.64, 0)
  1067. w.C1 = CFrame.new()
  1068. w.Parent = p
  1069. local p = Instance.new("Part")
  1070. p.Material = "SmoothPlastic"
  1071. p.Name = "Scope Window F"
  1072. p.CanCollide = false
  1073. p.formFactor = "Symmetric"
  1074. p.Size = Vector3.new(1, 1, 1)
  1075. p.BrickColor = BrickColor.new("White")
  1076. p.Reflectance = 0.3
  1077. p.Locked = true
  1078. p.TopSurface = 0
  1079. p.BottomSurface = 0
  1080. p.Parent = model
  1081. local m = Instance.new("CylinderMesh")
  1082. m.Scale = Vector3.new(0.27, 0.7, 0.27)
  1083. m.Offset = Vector3.new(0, -0.003 ,0)
  1084. m.Parent = p
  1085. local w = Instance.new("Weld")
  1086. w.Part0 = p
  1087. w.Part1 = ps
  1088. w.C0 = CFrame.new(0, 0.64, 0)
  1089. w.C1 = CFrame.new()
  1090. w.Parent = p
  1091. local p = Instance.new("Part")
  1092. p.Material = "SmoothPlastic"
  1093. p.Name = "Scope Window B"
  1094. p.CanCollide = false
  1095. p.formFactor = "Symmetric"
  1096. p.Size = Vector3.new(1, 1, 1)
  1097. p.BrickColor = BrickColor.new("White")
  1098. p.Reflectance = 0.3
  1099. p.Locked = true
  1100. p.TopSurface = 0
  1101. p.BottomSurface = 0
  1102. p.Parent = model
  1103. local m = Instance.new("CylinderMesh")
  1104. m.Scale = Vector3.new(0.23, 0.375, 0.23)
  1105. m.Offset = Vector3.new(0, 0.003 ,0)
  1106. m.Parent = p
  1107. local w = Instance.new("Weld")
  1108. w.Part0 = p
  1109. w.Part1 = ps
  1110. w.C0 = CFrame.new(0, -0.5, 0)
  1111. w.C1 = CFrame.new()
  1112. w.Parent = p--]]
  1113. if Ghillie == true then --Ghillie Wrap
  1114. local pa = Instance.new("Part")
  1115. pa.Material = "Grass"
  1116. pa.Name = "Wrap1"
  1117. pa.CanCollide = false
  1118. pa.formFactor = "Symmetric"
  1119. pa.Size = Vector3.new(1, 1, 1)
  1120. pa.BrickColor = WC
  1121. pa.Locked = true
  1122. pa.TopSurface = 0
  1123. pa.BottomSurface = 0
  1124. pa.Parent = model
  1125. local m = Instance.new("CylinderMesh")
  1126. m.Scale = Vector3.new(0.29, 0.6, 0.29)
  1127. m.Parent = pa
  1128. local w = Instance.new("Weld")
  1129. w.Part0 = pa
  1130. w.Part1 = pm
  1131. w.C0 = CFrame.new(0, 0.95, 0.38)
  1132. w.C1 = CFrame.new()
  1133. w.Parent = pa
  1134. local p = Instance.new("Part")
  1135. p.Material = "Grass"
  1136. p.Name = "Wrap1"
  1137. p.CanCollide = false
  1138. p.formFactor = "Symmetric"
  1139. p.Size = Vector3.new(1, 1, 1)
  1140. p.BrickColor = WC
  1141. p.Locked = true
  1142. p.TopSurface = 0
  1143. p.BottomSurface = 0
  1144. p.Parent = model
  1145. local m = Instance.new("BlockMesh")
  1146. m.Scale = Vector3.new(0.05, 0.4, 0.29)
  1147. m.Parent = p
  1148. local w = Instance.new("Weld")
  1149. w.Part0 = p
  1150. w.Part1 = pa
  1151. w.C0 = CFrame.new(-0.115, 0.1, -0.125)
  1152. w.C1 = CFrame.new()
  1153. w.Parent = p
  1154. local pa1 = Instance.new("Part")
  1155. pa1.Material = "Grass"
  1156. pa1.Name = "Wrap2"
  1157. pa1.CanCollide = false
  1158. pa1.formFactor = "Symmetric"
  1159. pa1.Size = Vector3.new(1, 1, 1)
  1160. pa1.BrickColor = WC
  1161. pa1.Locked = true
  1162. pa1.TopSurface = 0
  1163. pa1.BottomSurface = 0
  1164. pa1.Parent = model
  1165. local m = Instance.new("CylinderMesh")
  1166. m.Scale = Vector3.new(0.27, 0.4, 0.27)
  1167. m.Parent = pa1
  1168. local w = Instance.new("Weld")
  1169. w.Part0 = pa1
  1170. w.Part1 = pm
  1171. w.C0 = CFrame.new(0, 3.5, 0.06)
  1172. w.C1 = CFrame.new()
  1173. w.Parent = pa1
  1174. local p = Instance.new("Part")
  1175. p.Material = "Grass"
  1176. p.Name = "Wrap2"
  1177. p.CanCollide = false
  1178. p.formFactor = "Symmetric"
  1179. p.Size = Vector3.new(1, 1, 1)
  1180. p.BrickColor = WC
  1181. p.Locked = true
  1182. p.TopSurface = 0
  1183. p.BottomSurface = 0
  1184. p.Parent = model
  1185. local m = Instance.new("BlockMesh")
  1186. m.Scale = Vector3.new(0.05, 0.2, 0.27)
  1187. m.Parent = p
  1188. local w = Instance.new("Weld")
  1189. w.Part0 = p
  1190. w.Part1 = pa1
  1191. w.C0 = CFrame.new(0.1, 0.1, -0.125)
  1192. w.C1 = CFrame.new()
  1193. w.Parent = p
  1194. local pa2 = Instance.new("Part")
  1195. pa2.Material = "Grass"
  1196. pa2.Name = "Wrap3"
  1197. pa2.CanCollide = false
  1198. pa2.formFactor = "Symmetric"
  1199. pa2.Size = Vector3.new(1, 1, 1)
  1200. pa2.BrickColor = WC
  1201. pa2.Locked = true
  1202. pa2.TopSurface = 0
  1203. pa2.BottomSurface = 0
  1204. pa2.Parent = model
  1205. local m = Instance.new("CylinderMesh")
  1206. m.Scale = Vector3.new(0.23, 0.6, 0.23)
  1207. m.Parent = pa2
  1208. local w = Instance.new("Weld")
  1209. w.Part0 = pa2
  1210. w.Part1 = pm
  1211. w.C0 = CFrame.new(0, 2.8, 0.06)
  1212. w.C1 = CFrame.new()
  1213. w.Parent = pa2
  1214. local p = Instance.new("Part")
  1215. p.Material = "Grass"
  1216. p.Name = "Wrap3"
  1217. p.CanCollide = false
  1218. p.formFactor = "Symmetric"
  1219. p.Size = Vector3.new(1, 1, 1)
  1220. p.BrickColor = WC
  1221. p.Locked = true
  1222. p.TopSurface = 0
  1223. p.BottomSurface = 0
  1224. p.Parent = model
  1225. local m = Instance.new("BlockMesh")
  1226. m.Scale = Vector3.new(0.05, 0.4, 0.21)
  1227. m.Parent = p
  1228. local w = Instance.new("Weld")
  1229. w.Part0 = p
  1230. w.Part1 = pa2
  1231. w.C0 = CFrame.new(-0.08, 0.1, -0.125)
  1232. w.C1 = CFrame.new()
  1233. w.Parent = p
  1234. local p = Instance.new("Part")
  1235. p.Material = "Grass"
  1236. p.Name = "Wrap3"
  1237. p.CanCollide = false
  1238. p.formFactor = "Symmetric"
  1239. p.Size = Vector3.new(1, 1, 1)
  1240. p.BrickColor = WC
  1241. p.Locked = true
  1242. p.TopSurface = 0
  1243. p.BottomSurface = 0
  1244. p.Parent = model
  1245. local m = Instance.new("BlockMesh")
  1246. m.Scale = Vector3.new(0.05, 0.2, 0.21)
  1247. m.Parent = p
  1248. local w = Instance.new("Weld")
  1249. w.Part0 = p
  1250. w.Part1 = pa2
  1251. w.C0 = CFrame.new(0.08, -0.1, -0.125)
  1252. w.C1 = CFrame.new()
  1253. w.Parent = p
  1254. end
  1255. if Bipod == true then
  1256. local p = Instance.new("Part") ---Bipod
  1257. p.Material = "SmoothPlastic"
  1258. p.Name = "BipodM" --------------
  1259. p.CanCollide = false
  1260. p.formFactor = "Symmetric"
  1261. p.Size = Vector3.new(1, 1, 1)
  1262. p.BrickColor = DC
  1263. p.Reflectance = MR
  1264. p.Locked = true
  1265. p.TopSurface = 0
  1266. p.BottomSurface = 0
  1267. p.Parent = model
  1268. local m = Instance.new("BlockMesh")
  1269. m.Scale = Vector3.new(0.17, 0.25, 0.2)
  1270. m.Offset = Vector3.new(0, 0, 0.35)
  1271. m.Parent = p
  1272. local w = Instance.new("Weld")
  1273. w.Part0 = p
  1274. w.Part1 = pm
  1275. w.C0 = CFrame.new(0, 2.1, 0.05)
  1276. w.C1 = CFrame.new()
  1277. w.Parent = p
  1278. local p = Instance.new("Part")
  1279. p.Material = "SmoothPlastic"
  1280. p.Name = "BipodArm"
  1281. p.formFactor = "Symmetric"
  1282. p.Size = Vector3.new(1, 1, 1)
  1283. p.CanCollide = false
  1284. p.BrickColor = DC
  1285. p.Reflectance = MR
  1286. p.Locked = true
  1287. p.TopSurface = 0
  1288. p.BottomSurface = 0
  1289. p.Parent = model
  1290. local m = Instance.new("CylinderMesh")
  1291. m.Scale = Vector3.new(0.15, 1, 0.15)
  1292. m.Offset = Vector3.new(0.09, -0.4 ,0.4)
  1293. m.Parent = p
  1294. local w = Instance.new("Weld")
  1295. w.Part0 = p
  1296. w.Part1 = pm
  1297. w.C0 = CFrame.new(0, 2.1, 0.05)
  1298. w.C1 = CFrame.new()
  1299. w.Parent = p
  1300. local p = Instance.new("Part")
  1301. p.Material = "SmoothPlastic"
  1302. p.Name = "BipodArm"
  1303. p.formFactor = "Symmetric"
  1304. p.Size = Vector3.new(1, 1, 1)
  1305. p.CanCollide = false
  1306. p.BrickColor = DC
  1307. p.Reflectance = MR
  1308. p.Locked = true
  1309. p.TopSurface = 0
  1310. p.BottomSurface = 0
  1311. p.Parent = model
  1312. local m = Instance.new("CylinderMesh")
  1313. m.Scale = Vector3.new(0.15, 1, 0.15)
  1314. m.Offset = Vector3.new(-0.09, -0.4 ,0.4)
  1315. m.Parent = p
  1316. local w = Instance.new("Weld")
  1317. w.Part0 = p
  1318. w.Part1 = pm
  1319. w.C0 = CFrame.new(0, 2.1, 0.05)
  1320. w.C1 = CFrame.new()
  1321. w.Parent = p--]]
  1322. local p = Instance.new("Part") --------------- ButtSpike
  1323. p.Material = "SmoothPlastic"
  1324. p.Name = "ButtSpike"
  1325. p.formFactor = "Symmetric"
  1326. p.Size = Vector3.new(1, 1, 1)
  1327. p.BrickColor = BrickColor.new("Black")
  1328. p.CanCollide = false
  1329. p.Locked = true
  1330. p.TopSurface = 0
  1331. p.BottomSurface = 0
  1332. p.Parent = model
  1333. local m = Instance.new("CylinderMesh")
  1334. m.Scale = Vector3.new(0.2, 0.6, 0.2)
  1335. m.Parent = p
  1336. local w = Instance.new("Weld")
  1337. w.Part0 = p
  1338. w.Part1 = pm
  1339. w.C0 = CFrame.new(0, 0.5, -1.06) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
  1340. w.C1 = CFrame.new()
  1341. w.Parent = p
  1342. else end
  1343. return model
  1344. end
  1345.  
  1346.  
  1347. function removeParts(format)
  1348. if format == "RightHand" then
  1349. pcall(function() Player.Character[Name]:Remove() end)
  1350. elseif format == "LeftHand" then
  1351. pcall(function() Player.Character[Name.. " (Left)"]:Remove() end)
  1352. elseif format == "RightHolster" then
  1353. pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end)
  1354. elseif format == "LeftHolster" then
  1355. pcall(function() Player.Character[Name.. " (Holstered, Left)"]:Remove() end)
  1356. end
  1357. end
  1358.  
  1359.  
  1360. function SetAngle(Joint, Angle, Character)
  1361. if Character == nil then return false end
  1362. local Joints = {
  1363. Character.Torso:FindFirstChild("Right Shoulder 2"),
  1364. Character.Torso:FindFirstChild("Left Shoulder 2"),
  1365. Character.Torso:FindFirstChild("Right Hip 2"),
  1366. Character.Torso:FindFirstChild("Left Hip 2")
  1367. }
  1368. if Joints[Joint] == nil then return false end
  1369. if Joint == 1 or Joint == 3 then
  1370. Joints[Joint].DesiredAngle = Angle
  1371. end
  1372. if Joint == 2 or Joint == 4 then
  1373. Joints[Joint].DesiredAngle = -Angle
  1374. end
  1375. end
  1376.  
  1377.  
  1378. function ForceAngle(Joint, Angle, Character)
  1379. if Character == nil then return false end
  1380. local Joints = {
  1381. Character.Torso:FindFirstChild("Right Shoulder 2"),
  1382. Character.Torso:FindFirstChild("Left Shoulder 2"),
  1383. Character.Torso:FindFirstChild("Right Hip 2"),
  1384. Character.Torso:FindFirstChild("Left Hip 2")
  1385. }
  1386. if Joints[Joint] == nil then return false end
  1387. if Joint == 1 or Joint == 3 then
  1388. Joints[Joint].DesiredAngle = Angle
  1389. Joints[Joint].CurrentAngle = Angle
  1390. end
  1391. if Joint == 2 or Joint == 4 then
  1392. Joints[Joint].DesiredAngle = -Angle
  1393. Joints[Joint].CurrentAngle = -Angle
  1394. end
  1395. end
  1396.  
  1397.  
  1398. function SetSpeed(Joint, Speed, Character)
  1399. if Character == nil then return false end
  1400. local Joints = {
  1401. Character.Torso:FindFirstChild("Right Shoulder 2"),
  1402. Character.Torso:FindFirstChild("Left Shoulder 2"),
  1403. Character.Torso:FindFirstChild("Right Hip 2"),
  1404. Character.Torso:FindFirstChild("Left Hip 2")
  1405. }
  1406. if Joints[Joint] == nil then return false end
  1407. Joints[Joint].MaxVelocity = Speed
  1408. end
  1409.  
  1410.  
  1411. function DisableLimb(Limb, Character)
  1412. if Character == nil then return false end
  1413. if Character:FindFirstChild("Torso") == nil then return false end
  1414. local Joints = {
  1415. Character.Torso:FindFirstChild("Right Shoulder"),
  1416. Character.Torso:FindFirstChild("Left Shoulder"),
  1417. Character.Torso:FindFirstChild("Right Hip"),
  1418. Character.Torso:FindFirstChild("Left Hip")
  1419. }
  1420. local Limbs = {
  1421. Character:FindFirstChild("Right Arm"),
  1422. Character:FindFirstChild("Left Arm"),
  1423. Character:FindFirstChild("Right Leg"),
  1424. Character:FindFirstChild("Left Leg")
  1425. }
  1426. if Joints[Limb] == nil then return false end
  1427. if Limbs[Limb] == nil then return false end
  1428. local Joint = Instance.new("Motor")
  1429. Joint.Parent = Character.Torso
  1430. Joint.Part0 = Character.Torso
  1431. Joint.Part1 = Limbs[Limb]
  1432. if Limb == 1 then
  1433. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1434. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1435. Joint.Name = "Right Shoulder 2"
  1436. elseif Limb == 2 then
  1437. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1438. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1439. Joint.Name = "Left Shoulder 2"
  1440. elseif Limb == 3 then
  1441. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1442. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1443. Joint.Name = "Right Hip 2"
  1444. elseif Limb == 4 then
  1445. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1446. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1447. Joint.Name = "Left Hip 2"
  1448. end
  1449. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  1450. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  1451. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  1452. Joints[Limb]:Remove()
  1453. end
  1454.  
  1455.  
  1456. function ResetLimbCFrame(Limb, Character)
  1457. if Character == nil then return false end
  1458. if Character.Parent == nil then return false end
  1459. if Character:FindFirstChild("Torso") == nil then return false end
  1460. local Joints = {
  1461. Character.Torso:FindFirstChild("Right Shoulder 2"),
  1462. Character.Torso:FindFirstChild("Left Shoulder 2"),
  1463. Character.Torso:FindFirstChild("Right Hip 2"),
  1464. Character.Torso:FindFirstChild("Left Hip 2")
  1465. }
  1466. local Limbs = {
  1467. Character:FindFirstChild("Right Arm"),
  1468. Character:FindFirstChild("Left Arm"),
  1469. Character:FindFirstChild("Right Leg"),
  1470. Character:FindFirstChild("Left Leg")
  1471. }
  1472. if Joints[Limb] == nil then return false end
  1473. if Limbs[Limb] == nil then return false end
  1474. if Limb == 1 then
  1475. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1476. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1477. elseif Limb == 2 then
  1478. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1479. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1480. elseif Limb == 3 then
  1481. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1482. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1483. elseif Limb == 4 then
  1484. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1485. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1486. end
  1487. end
  1488.  
  1489.  
  1490. function EnableLimb(Limb, Character)
  1491. if Character == nil then return false end
  1492. if Character:FindFirstChild("Torso") == nil then return false end
  1493. local Joints = {
  1494. Character.Torso:FindFirstChild("Right Shoulder 2"),
  1495. Character.Torso:FindFirstChild("Left Shoulder 2"),
  1496. Character.Torso:FindFirstChild("Right Hip 2"),
  1497. Character.Torso:FindFirstChild("Left Hip 2")
  1498. }
  1499. local Limbs = {
  1500. Character:FindFirstChild("Right Arm"),
  1501. Character:FindFirstChild("Left Arm"),
  1502. Character:FindFirstChild("Right Leg"),
  1503. Character:FindFirstChild("Left Leg")
  1504. }
  1505. if Joints[Limb] == nil then return false end
  1506. if Limbs[Limb] == nil then return false end
  1507. if Limb == 1 then
  1508. Joints[Limb].Name = "Right Shoulder"
  1509. elseif Limb == 2 then
  1510. Joints[Limb].Name = "Left Shoulder"
  1511. elseif Limb == 3 then
  1512. Joints[Limb].Name = "Right Hip"
  1513. elseif Limb == 4 then
  1514. Joints[Limb].Name = "Left Hip"
  1515. end
  1516. Animate = Character:FindFirstChild("Animate")
  1517. if Animate == nil then return false end
  1518. Animate = Animate:Clone()
  1519. Character.Animate:Remove()
  1520. Animate.Parent = Character
  1521. end
  1522.  
  1523.  
  1524. function playAnimation(format, mouse)
  1525. if format == "equip" then
  1526. Player.Character.Humanoid.WalkSpeed = WSPenalty
  1527. EnableLimb(1, Player.Character)
  1528. EnableLimb(2, Player.Character)
  1529. DisableLimb(2, Player.Character)
  1530. SetSpeed(2, 0.1, Player.Character)
  1531. ForceAngle(2, 0, Player.Character)
  1532. SetAngle(2, math.rad(-50), Player.Character)
  1533. wait(0.25)
  1534. if Player.Character:FindFirstChild(Name.. " (Holstered)") == nil then makeParts("RightHolster") end
  1535. Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
  1536. local w = Instance.new("Weld")
  1537. w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
  1538. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  1539. w.C0 = CFrame.new(0.5, -0.25, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1540. w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50), 0, 0)
  1541. w.Parent = Player.Character[Name.. " (Holstered)"].Handle
  1542. SetAngle(2, 0, Player.Character)
  1543. wait(0.25)
  1544. DisableLimb(1, Player.Character)
  1545. ForceAngle(1, 0, Player.Character)
  1546. delay(0.3, function() Player.Character[Name.. " (Holstered)"].Handle.Equip:Play() end)
  1547. for i = 0, 1, 0.05 do
  1548. if Player.Character:FindFirstChild("Torso") ~= nil then
  1549. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1550. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1551. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.5 * i) + (1.5 * (1 - i)), 1.2 * i, 0.8 * i) * CFrame.fromEulerAnglesXYZ(math.rad(300 + ((1 - i) * 50)), math.rad(10), math.rad(-90) * i)
  1552. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1553. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-0.9 * i) + (-1.5 * (1 - i)), -0.35 * i, 0.51 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
  1554. w.C0 = CFrame.new(0.5 - (i * (0.5 * 2)), -0.25 - (i * (-0.25 * 2)), -0.75 - (i * (-0.75 * 2))) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 + (i * 180)), 0)
  1555. w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50 - i * 25), 0, -math.rad(i * 15))
  1556. wait()
  1557. else return false end
  1558. else return false end
  1559. end
  1560. return playAnimation("hold")
  1561. end
  1562. if format == "unequip" then
  1563. Player.Character.Humanoid.WalkSpeed = 16
  1564. Player.Character[Name].Handle.Weld:Remove()
  1565. local w = Instance.new("Weld")
  1566. w.Part0 = Player.Character[Name].Handle
  1567. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  1568. w.C0 = CFrame.new(0.5, -0.25, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1569. w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50), 0, 0)
  1570. w.Parent = Player.Character[Name].Handle
  1571. for i = 1, 0, -0.05 do
  1572. if Player.Character:FindFirstChild("Torso") ~= nil then
  1573. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1574. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1575. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.5 * i) + (1.5 * (1 - i)), 1.2 * i, 0.8 * i) * CFrame.fromEulerAnglesXYZ(math.rad(300 + ((1 - i) * 50)), math.rad(10), math.rad(-90) * i)
  1576. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1577. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-0.9 * i) + (-1.5 * (1 - i)), -0.35 * i, 0.51 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
  1578. w.C0 = CFrame.new(0.5 - (i * (0.5 * 2)), -0.25 - (i * (-0.25 * 2)), -0.75 - (i * (-0.75 * 2))) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 + (i * 180)), 0)
  1579. w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50 - i * 25), 0, -math.rad(i * 15))
  1580. wait()
  1581. else return false end
  1582. else return false end
  1583. end
  1584. w.C0 = CFrame.new(0.5, -0.25, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1585. w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50), 0, 0)
  1586. ResetLimbCFrame(1, Player.Character)
  1587. ResetLimbCFrame(2, Player.Character)
  1588. EnableLimb(1, Player.Character)
  1589. EnableLimb(2, Player.Character)
  1590. DisableLimb(2, Player.Character)
  1591. SetSpeed(2, 0.1, Player.Character)
  1592. ForceAngle(2, 0, Player.Character)
  1593. SetAngle(2, math.rad(-50), Player.Character)
  1594. wait(0.25)
  1595. SetAngle(2, 0, Player.Character)
  1596. removeParts("RightHand")
  1597. makeParts("RightHolster")
  1598. wait(0.25)
  1599. makeParts("RightHand")
  1600. removeParts("RightHolster")
  1601. return true
  1602. end
  1603. if format == "hold" then
  1604. if Player.Character:FindFirstChild("Torso") ~= nil then
  1605. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1606. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1607. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10), math.rad(-90))
  1608. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1609. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  1610. else return false end
  1611. else return false end
  1612. end
  1613. if format == "reload" then
  1614. for i = 0, 25, 5 do
  1615. if Player.Character:FindFirstChild("Torso") ~= nil then
  1616. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1617. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1618. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0)
  1619. wait()
  1620. else return false end
  1621. else return false end
  1622. end
  1623. Player.Character[Name].Handle.Release:Play()
  1624. Player.Character[Name].Magazine.Transparency = 1
  1625. magazineDrop = Player.Character[Name].Magazine:Clone()
  1626. magazineDrop.Transparency = 0
  1627. magazineDrop.CanCollide = true
  1628. magazineDrop.Parent = game.Workspace
  1629. coroutine.resume(coroutine.create(function(part) wait(4.5) for i = 0, 1, 0.1 do part.Transparency = i wait() end part:Remove() end), magazineDrop)
  1630. delay(0.1, function() magazineDrop.CanCollide = true end)
  1631. for i = 0, 25, 5 do
  1632. if Player.Character:FindFirstChild("Torso") ~= nil then
  1633. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1634. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1635. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 + (i / 60), 1.2 - (i / 20), 0.8 + (i / 35)) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 + -i * 3.5), math.rad(-90))
  1636. wait()
  1637. else return false end
  1638. else return false end
  1639. end
  1640. magazineNew = Player.Character[Name].Magazine:Clone()
  1641. magazineNew.Name = "New Magazine"
  1642. magazineNew.Transparency = 0
  1643. magazineNew.Parent = Player.Character[Name]
  1644. local w = Instance.new("Weld")
  1645. w.Part0 = magazineNew
  1646. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  1647. w.C0 = CFrame.new(0, 1.1, 0)
  1648. w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1649. w.Parent = magazineNew
  1650. wait(0.2)
  1651. for i = 25, 0, -5 do
  1652. if Player.Character:FindFirstChild("Torso") ~= nil then
  1653. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1654. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1655. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 + ((i + 10) / 60), 1.2 - ((i + 10) / 20), 0.8 + (i / 35)) * CFrame.fromEulerAnglesXYZ(math.rad(300 - (i - 10)), math.rad(10 + -i * 3.5), math.rad(-90))
  1656. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1657. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9 + ((25 - i) / 30), -0.35, 0.6 + ((25 - i) / 25)) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), math.rad((25 * 2) - (i * 2)))
  1658. wait()
  1659. else return false end
  1660. else return false end
  1661. end
  1662. Player.Character[Name].Magazine.Transparency = 0
  1663. Player.Character[Name]["New Magazine"]:Remove()
  1664. Player.Character[Name].Handle.Jam:Play()
  1665. wait(0.04)
  1666. Player.Character[Name].Handle.Reload:Play()
  1667. wait(0.1)
  1668. if Player.Character:FindFirstChild("Torso") ~= nil then
  1669. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1670. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1671. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10), math.rad(-90))
  1672. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1673. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  1674. else return false end
  1675. else return false end
  1676. end
  1677. if format == "bolt" then
  1678. Player.Character[Name].Handle.Weld:Remove()
  1679. local w = Instance.new("Weld")
  1680. w.Part0 = Player.Character[Name].Handle
  1681. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  1682. w.C0 = CFrame.new(-0.85, -0.3, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(15), math.rad(90), 0)
  1683. w.C1 = CFrame.new(0, 0.4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(40), 0, 0)
  1684. w.Parent = Player.Character[Name].Handle
  1685. if Player.Character:FindFirstChild("Torso") ~= nil then
  1686. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1687. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1688. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.4, 0.9, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(280), math.rad(-10), math.rad(-90))
  1689. else return false end
  1690. else return false end
  1691. wait(0.2)
  1692. Player.Character[Name].Handle.Action1:Play()
  1693. for i = 0, 1, 0.25 do
  1694. if Player.Character:FindFirstChild("Torso") ~= nil then
  1695. if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1696. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1697. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1.2, 0, 0 + i) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  1698. wait()
  1699. else return false end
  1700. else return false end
  1701. end
  1702. Player.Character[Name].BoltKnob.Weld.C0 = CFrame.new(-0.2, 0, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-15), 0)
  1703. wait(0.08)
  1704. Player.Character[Name].Handle.Action2:Play()
  1705. for i = 0, 1, 0.25 do
  1706. if Player.Character:FindFirstChild("Torso") ~= nil then
  1707. if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1708. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1709. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1.2, 0 - (i / 1.5), 0.9) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  1710. wait()
  1711. else return false end
  1712. else return false end
  1713. end
  1714. Player.Character[Name].Handle.Action3:Play()
  1715. Player.Character[Name].Bolt.Weld.C0 = CFrame.new(0, -0.45, 0.06)
  1716. if magazine.Value ~= 0 then
  1717. makeShell(Player.Character[Name]:FindFirstChild("ShellOut"))
  1718. else end
  1719. wait(0.08)
  1720. for i = 1, 0, -0.25 do
  1721. if Player.Character:FindFirstChild("Torso") ~= nil then
  1722. if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1723. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1724. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1.2, 0 - (i / 1.5), 0.9) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  1725. wait()
  1726. else return false end
  1727. else return false end
  1728. end
  1729. Player.Character[Name].Bolt.Weld.C0 = CFrame.new(0, -0.2, 0.06)
  1730. wait(0.02)
  1731. removeParts("RightHand")
  1732. makeParts("RightHand")
  1733. playAnimation("hold")
  1734. return true
  1735. end
  1736. if format == "fire" then
  1737. coroutine.resume(coroutine.create(function()
  1738. Player.Character[Name].Trigger.Weld.C0 = CFrame.new(0, -0.08, -0.25)
  1739. Player.Character[Name].Handle.Empty:Play()
  1740. wait(0.2)
  1741. Player.Character[Name].Trigger.Weld.C0 = CFrame.new(0, 0.02, -0.25)
  1742. end))
  1743. if Player.Character[Name]:FindFirstChild("Handle") ~= nil then
  1744. if silenced then
  1745. Player.Character[Name].Handle.Fire2.Volume = math.random(3, 8) / 10
  1746. Player.Character[Name].Handle.Fire2.Pitch = math.random(20, 25) / 10
  1747. Player.Character[Name].Handle.Fire2:Play()
  1748. CamShake(10, 2000)
  1749. else
  1750. Player.Character[Name].Handle.Fire.Volume = math.random(9, 10) / 10
  1751. Player.Character[Name].Handle.Fire:Play()
  1752. CamShake(10, 2000)
  1753. end
  1754. else return false end
  1755. if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then
  1756. if silenced == false then
  1757. coroutine.resume(coroutine.create(function() Player.Character[Name].Muzzle.Smoke.Enabled = true Player.Character[Name].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name].Muzzle.Smoke.Enabled = false Player.Character[Name].Muzzle.Fire.Enabled = false end))
  1758. else end
  1759. else return false end
  1760. for i = 0, 15, 5 do
  1761. if Player.Character:FindFirstChild("Torso") ~= nil then
  1762. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1763. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1764. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
  1765. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1766. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1767. wait()
  1768. else return false end
  1769. else return false end
  1770. end
  1771. for i = 15, 0, -5 do
  1772. if Player.Character:FindFirstChild("Torso") ~= nil then
  1773. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1774. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1775. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
  1776. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1777. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1778. wait()
  1779. else return false end
  1780. else return false end
  1781. end
  1782. end
  1783. return true
  1784. end
  1785.  
  1786.  
  1787. function CamShake(time, freq)
  1788. coroutine.resume(coroutine.create(function()
  1789. local cam = game:GetService("Workspace").CurrentCamera
  1790. local time = 10
  1791. local seed = Vector3.new(math.random(100, 200) / freq, math.random(100, 200) / freq, 0)
  1792. if math.random(1, 2) == 1 then seed = Vector3.new(-seed.x, seed.y, 0) end
  1793. if math.random(1, 2) == 1 then seed = Vector3.new(seed.x, -seed.y, 0) end
  1794. cam.CoordinateFrame = (CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(seed.x * time, seed.y * time, 0)) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude)
  1795. for i = 1, time do
  1796. cam.CoordinateFrame = (CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(-seed.x, -seed.y, 0)) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude)
  1797. wait()
  1798. end
  1799. end))
  1800. end
  1801.  
  1802.  
  1803. function makeShell(part)
  1804. if part == nil then return false end
  1805. local casing = Instance.new("Part")
  1806. casing.Name = "Shell"
  1807. casing.formFactor = "Custom"
  1808. casing.Size = Vector3.new(0.2, 0.28, 0.2)
  1809. casing.CFrame = CFrame.new(part.Position) * CFrame.fromEulerAnglesXYZ(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)))
  1810. casing.BrickColor = BrickColor.new("New Yeller")
  1811. local mesh = Instance.new("CylinderMesh")
  1812. mesh.Scale = Vector3.new(0.8, 1.4, 0.8)
  1813. mesh.Parent = casing
  1814. local s = Instance.new("Sound")
  1815. s.Name = "Ding"
  1816. s.SoundId = "http://www.roblox.com/Asset/?id=13114759"
  1817. s.Volume = 0.4
  1818. s.Pitch = 2.5
  1819. s.Looped = false
  1820. s.Parent = casing
  1821. casing.Parent = game:GetService("Workspace")
  1822. casing.Ding:Play()
  1823. casing:BreakJoints()
  1824. casing.Velocity = (part.CFrame.lookVector * 65) + Vector3.new(0, 10, 0)
  1825. coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do casing.Transparency = i wait() end casing:Remove() end))
  1826. end
  1827.  
  1828.  
  1829. function Weld(x, y)
  1830. local weld = Instance.new("Weld")
  1831. weld.Part0 = x
  1832. weld.Part1 = y
  1833. CJ = CFrame.new(x.Position)
  1834. C0 = x.CFrame:inverse() * CJ
  1835. C1 = y.CFrame:inverse() * CJ
  1836. weld.C0 = C0
  1837. weld.C1 = C1
  1838. weld.Parent = x
  1839. end
  1840.  
  1841.  
  1842. function tagHumanoid(humanoid)
  1843. local tag = Instance.new("ObjectValue")
  1844. tag.Name = "creator"
  1845. tag.Value = Player
  1846. tag.Parent = humanoid
  1847. local tag = Instance.new("StringValue")
  1848. tag.Name = "creatorType1"
  1849. tag.Value = Name
  1850. tag.Parent = humanoid
  1851. local tag = Instance.new("StringValue")
  1852. tag.Name = "creatorType2"
  1853. tag.Value = "shot"
  1854. tag.Parent = humanoid
  1855. end
  1856.  
  1857.  
  1858. function untagHumanoid(humanoid)
  1859. if humanoid ~= nil then
  1860. local tag = humanoid:FindFirstChild("creator")
  1861. if tag ~= nil then
  1862. tag:Remove()
  1863. end
  1864. local tag = humanoid:FindFirstChild("creatorType1")
  1865. if tag ~= nil then
  1866. tag:Remove()
  1867. end
  1868. local tag = humanoid:FindFirstChild("creatorType2")
  1869. if tag ~= nil then
  1870. tag:Remove()
  1871. end
  1872. end
  1873. end
  1874.  
  1875.  
  1876. function fire(startPoint, endPoint, hit)
  1877. local damage1 = damage
  1878. if Raycast ~= false then
  1879. if hit ~= nil then
  1880. local Ray = Ray.new(startPoint, (endPoint - startPoint).unit*300)
  1881. local Hit, Position = game.Workspace:FindPartOnRay(Ray, Player.Character)
  1882. if Hit then
  1883. if Hit.Material == "Grass" then
  1884. damage1 = damage1 / 6
  1885. elseif Hit.Material == "DiamondPlate" then
  1886. damage1 = damage1 / 6
  1887. elseif Hit.Material == "Slate" then
  1888. damage1 = damage1 / 6
  1889. elseif Hit.Material == "Plastic" then
  1890. damage1 = damage1 / 4
  1891. elseif Hit.Material == "Ice" then
  1892. damage1 = damage1 / 6
  1893. elseif Hit.Material == "Concrete" then
  1894. damage1 = damage1 / 7
  1895. elseif Hit.Material == "RustedMetal" then
  1896. damage1 = damage1 / 2
  1897. else end
  1898. end
  1899. if Hit.Parent:FindFirstChild("Humanoid") then
  1900. if Hit.Name == "Head" then
  1901. Hit.Parent.Humanoid:TakeDamage(damage1 * 10)
  1902. damage1 = damage1 / 2
  1903. elseif Hit.Name == "Torso" then
  1904. Hit.Parent.Humanoid:TakeDamage(damage1 * 2)
  1905. damage1 = damage1 / 2
  1906. elseif hit.Name == "Left Leg" then
  1907. Hit.Parent.Humanoid:TakeDamage(damage1)
  1908. damage1 = damage1 / 2
  1909. Hit.Parent.Humanoid.Sit = true
  1910. elseif hit.Name == "Right Leg" then
  1911. Hit.Parent.Humanoid:TakeDamage(damage1)
  1912. damage1 = damage1 / 2
  1913. Hit.Parent.Humanoid.Sit = true
  1914. else
  1915. Hit.Parent.Humanoid:TakeDamage(damage1)
  1916. damage1 = damage1 / 2
  1917. end
  1918. end
  1919. else end
  1920. else end
  1921. local trail = Instance.new("Part")
  1922. trail.Name = "Bullet Trail"
  1923. trail.BrickColor = BrickColor.new("Dark stone grey")
  1924. trail.TopSurface = 0
  1925. trail.BottomSurface = 0
  1926. trail.formFactor = 0
  1927. trail.Size = Vector3.new(1, 1, 1)
  1928. trail.Transparency = 0.5
  1929. trail.Anchored = true
  1930. trail.CanCollide = false
  1931. trail.CFrame = CFrame.new((startPoint + endPoint) / 2, endPoint)
  1932. trail.Parent = game:GetService("Workspace")
  1933. local mesh = Instance.new("SpecialMesh")
  1934. mesh.MeshType = "Brick"
  1935. mesh.Scale = Vector3.new(0.1, 0.1, (startPoint - endPoint).magnitude)
  1936. mesh.Parent = trail
  1937. coroutine.resume(coroutine.create(function(part) for i = 1, 10 do part.Mesh.Scale = Vector3.new(part.Mesh.Scale.x - 0.01, part.Mesh.Scale.y - 0.01, part.Mesh.Scale.z) wait() end part:Remove() end), trail)
  1938. if hit ~= nil then
  1939. if hit.Parent == nil then return end
  1940. if hit.Parent.ClassName == "Hat" then
  1941. if hit.Parent.Parent.Humanoid ~= nil then
  1942. hit.Parent.Parent.Humanoid:TakeDamage(damage * 5)
  1943. end
  1944. end
  1945. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  1946. tagHumanoid(hit.Parent.Humanoid)
  1947. if hit.Name == "Head" then
  1948. hit.Parent.Humanoid:TakeDamage(damage1 * 10)
  1949. elseif hit.Name == "Torso" then
  1950. hit.Parent.Humanoid:TakeDamage(damage1 * 2)
  1951. elseif hit.Name == "Left Leg" then
  1952. hit.Parent.Humanoid:TakeDamage(damage1)
  1953. hit.Parent.Humanoid.Sit = true
  1954. elseif hit.Name == "Right Leg" then
  1955. hit.Parent.Humanoid:TakeDamage(damage1)
  1956. hit.Parent.Humanoid.Sit = true
  1957. else
  1958. hit.Parent.Humanoid:TakeDamage(damage1)
  1959. end
  1960. if math.random(1, 3) == 1 then
  1961. hit.Parent.Humanoid.Sit = true
  1962. end
  1963. delay(0.1, function() untagHumanoid(hit.Parent.Humanoid) end)
  1964. end
  1965. if hit.Anchored == false then
  1966. hit.Velocity = hit.Velocity + ((endPoint - startPoint).unit * (damage1 * 4))
  1967. end
  1968. end
  1969. end
  1970.  
  1971.  
  1972. function onButton1Down(mouse)
  1973. if selected == false then return end
  1974. if Player.Character:FindFirstChild(Name) ~= nil and Button1Down == false and canFire == true and (function() if dual == true then if Player.Character:FindFirstChild(Name.. " (Left)") ~= nil then return true else return false end else return true end end)() == true then
  1975. if Player.Character[Name]:FindFirstChild("Handle") == nil then return end
  1976. if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
  1977. if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end end
  1978. if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end end
  1979. mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
  1980. Button1Down = true
  1981. canFire = false
  1982. canFire2 = true
  1983. while canFire2 == true do
  1984. local humanoid = Player.Character:FindFirstChild("Humanoid")
  1985. if humanoid == nil then
  1986. canFire2 = false
  1987. break
  1988. end
  1989. if humanoid.Health <= 0 then
  1990. canFire2 = false
  1991. break
  1992. end
  1993. local fireLeft = false
  1994. if automatic == false and burst == false then
  1995. canFire2 = false
  1996. elseif automatic == false and burst == true then
  1997. if burstCount >= burstCountMax then
  1998. canFire2 = false
  1999. burstCount = 0
  2000. break
  2001. end
  2002. burstCount = burstCount + 1
  2003. elseif automatic == true and burst == false then
  2004. fireLeft = true
  2005. end
  2006. if Chambered == true then
  2007. Chambered = false
  2008. fire(Player.Character[Name].Muzzle.Position, mouse.Hit.p, mouse.Target)
  2009. coroutine.resume(coroutine.create(function()
  2010. if dual == true then
  2011. playAnimation("rightFire")
  2012. elseif dual == false then
  2013. playAnimation("fire")
  2014. end
  2015. end))
  2016. else
  2017. Player.Character[Name].Handle.Empty:Play()
  2018. end
  2019. if fireLeft == true and dual == true and automatic == true then
  2020. if magazine.Value > 0 then
  2021. coroutine.resume(coroutine.create(function()
  2022. wait(readyTime / 2)
  2023. magazine.Value = magazine.Value - 1
  2024. updateGui()
  2025. fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
  2026. playAnimation("leftFire")
  2027. end))
  2028. else
  2029. coroutine.resume(coroutine.create(function()
  2030. wait(readyTime / 2)
  2031. Player.Character[Name].Handle.Empty:Play()
  2032. end))
  2033. end
  2034. end
  2035. end
  2036. canFire = true
  2037. mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
  2038. end
  2039. end
  2040.  
  2041.  
  2042. function onButton1Up(mouse)
  2043. if selected == false then return end
  2044. Button1Down = false
  2045. canFire2 = false
  2046. burstCount = 0
  2047. while canFire == false do wait() end
  2048. if dual == true and automatic == false then
  2049. if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end
  2050. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
  2051. mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
  2052. canFire = false
  2053. canFire2 = true
  2054. while canFire2 == true do
  2055. local humanoid = Player.Character:FindFirstChild("Humanoid")
  2056. if humanoid == nil then
  2057. canFire2 = false
  2058. break
  2059. end
  2060. if humanoid.Health <= 0 then
  2061. canFire2 = false
  2062. break
  2063. end
  2064. if burst == false then
  2065. canFire2 = false
  2066. elseif burst == true then
  2067. if burstCount >= burstCountMax then
  2068. canFire2 = false
  2069. burstCount = 0
  2070. break
  2071. end
  2072. burstCount = burstCount + 1
  2073. end
  2074. if magazine.Value <= 0 then
  2075. Player.Character[Name].Handle.Empty:Play()
  2076. else
  2077. coroutine.resume(coroutine.create(function()
  2078. playAnimation("leftFire")
  2079. end))
  2080. magazine.Value = magazine.Value - 1
  2081. updateGui()
  2082. fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
  2083. end
  2084. wait(readyTime)
  2085. end
  2086. mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
  2087. canFire = true
  2088. end
  2089. end
  2090.  
  2091.  
  2092. function onKeyDown(key, mouse)
  2093. if selected == false then return end
  2094. key = key:lower()
  2095. if key == "q" and Button1Down == false and canFire == true then
  2096. if mouse.Target == nil then return end
  2097. if game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent) ~= nil then
  2098. if dual == true then onKeyDown("t", mouse) end
  2099. onDeselected(mouse)
  2100. removeParts("RightHolster")
  2101. script.Parent.Parent = game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent).Backpack
  2102. end
  2103. end
  2104. if key == "e" and Button1Down == false and canFire == true and canSilence == true then
  2105. if silenced then
  2106. silenced = false
  2107. if Player.Character:FindFirstChild(Name) == nil then return end
  2108. if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
  2109. if Player.Character[Name]:FindFirstChild("Muzzle 2") == nil then return end
  2110. Player.Character[Name].Muzzle.Transparency = 1
  2111. Player.Character[Name].Silencer1.Transparency = 1
  2112. Player.Character[Name].Silencer2.Transparency = 1
  2113. Player.Character[Name].Muzzle.Name = "Silencer"
  2114. Player.Character[Name]["Muzzle 2"].Name = "Muzzle"
  2115. if dual == true then
  2116. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
  2117. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle 2") == nil then return end
  2118. Player.Character[Name.. " (Left)"].Muzzle.Transparency = 1
  2119. Player.Character[Name.. " (Left)"].Muzzle.Name = "Silencer"
  2120. Player.Character[Name.. " (Left)"]["Muzzle 2"].Name = "Muzzle"
  2121. end
  2122. else
  2123. silenced = true
  2124. if Player.Character:FindFirstChild(Name) == nil then return end
  2125. if Player.Character[Name]:FindFirstChild("Silencer") == nil then return end
  2126. if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
  2127. Player.Character[Name].Silencer.Transparency = 0
  2128. Player.Character[Name].Silencer1.Transparency = 0
  2129. Player.Character[Name].Silencer2.Transparency = 0
  2130. Player.Character[Name].Muzzle.Name = "Muzzle 2"
  2131. Player.Character[Name].Silencer.Name = "Muzzle"
  2132. if dual == true then
  2133. if Player.Character[Name.. " (Left)"]:FindFirstChild("Silencer") == nil then return end
  2134. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
  2135. Player.Character[Name.. " (Left)"].Silencer.Transparency = 0
  2136. Player.Character[Name.. " (Left)"].Muzzle.Name = "Muzzle 2"
  2137. Player.Character[Name.. " (Left)"].Silencer.Name = "Muzzle"
  2138. end
  2139. end
  2140. end
  2141. if key == "r" and Button1Down == false and canFire == true then
  2142. if zoom == true then
  2143. onKeyDown("y", mouse)
  2144. else end
  2145. if ammo.Value > 0 and magazine.Value ~= magazineMax.Value then
  2146. canFire = false
  2147. burstCount = 0
  2148. mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
  2149. if magazine.Value > 0 then magazine.Value = 0 end
  2150. updateGui()
  2151. if dual == true then
  2152. playAnimation("reloadDual")
  2153. elseif dual == false then
  2154. playAnimation("reload")
  2155. end
  2156. if ammo.Value - magazineMax.Value < 0 then
  2157. magazine.Value = ammo.Value
  2158. ammo.Value = 0
  2159. elseif ammo.Value - magazineMax.Value >= 0 then
  2160. ammo.Value = ammo.Value - magazineMax.Value
  2161. magazine.Value = magazine.Value + magazineMax.Value
  2162. end
  2163. updateGui()
  2164. mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
  2165. canFire = true
  2166. end
  2167. end
  2168. if key == "t" and Button1Down == false and canFire == true and canDual == true then
  2169. canFire = false
  2170. if dual == false then
  2171. local weapon = nil
  2172. for _, p in pairs(Player.Backpack:GetChildren()) do
  2173. if p.Name == Name and p ~= script.Parent then weapon = p break end
  2174. end
  2175. if weapon ~= nil then
  2176. dual = true
  2177. weapon.Name = "Dual"
  2178. weapon.Parent = script
  2179. silenced = false
  2180. removeParts("RightHand")
  2181. makeParts("RightHand")
  2182. removeParts("RightHolster")
  2183. makeParts("LeftHolster")
  2184. playAnimation("leftEquip")
  2185. removeParts("LeftHolster")
  2186. makeParts("LeftHand")
  2187. magazineMax.Value = math.ceil(magazineMax.Value * 2)
  2188. ammoMax.Value = math.ceil(ammoMax.Value * 2)
  2189. magazine.Value = magazine.Value + weapon.Magazine.Value
  2190. ammo.Value = ammo.Value + weapon.Ammo.Value
  2191. updateGui()
  2192. end
  2193. elseif dual == true then
  2194. local weapon = script:FindFirstChild("Dual")
  2195. if weapon ~= nil then
  2196. dual = false
  2197. weapon.Name = Name
  2198. weapon.Parent = Player.Backpack
  2199. silenced = false
  2200. removeParts("RightHand")
  2201. makeParts("RightHand")
  2202. playAnimation("leftUnequip")
  2203. removeParts("LeftHand")
  2204. makeParts("RightHolster")
  2205. playAnimation("hold")
  2206. weapon.Magazine.Value = math.floor(magazine.Value / 2)
  2207. weapon.Ammo.Value = math.floor(ammo.Value / 2)
  2208. magazineMax.Value = math.ceil(magazineMax.Value / 2)
  2209. ammoMax.Value = math.ceil(ammoMax.Value / 2)
  2210. magazine.Value = math.ceil(magazine.Value / 2)
  2211. ammo.Value = math.ceil(ammo.Value / 2)
  2212. updateGui()
  2213. end
  2214. end
  2215. canFire = true
  2216. end
  2217. if key == "y" and canZoom == true then
  2218. if zoom == false then
  2219. zoom = true
  2220. local pos = mouse.Hit.p
  2221. local target = mouse.Target
  2222. local cam = game:GetService("Workspace").CurrentCamera
  2223. focus = Instance.new("Part", workspace)
  2224. focus.Anchored = true
  2225. focus.CanCollide = false
  2226. focus.Transparency = 1
  2227. focus.TopSurface = 0
  2228. focus.BottomSurface = 0
  2229. focus.formFactor = "Plate"
  2230. focus.Size = Vector3.new(0, 0, 0)
  2231. focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
  2232. cam.CameraSubject = focus
  2233. cam.CameraType = "Attach"
  2234. while zoom == true and selected == true do
  2235. local set = false
  2236. if target ~= nil then
  2237. if target.Parent ~= nil then
  2238. if target.Anchored == false then
  2239. focus.CFrame = CFrame.new(target.CFrame.p) * (CFrame.new(Player.Character.Torso.CFrame.p, target.CFrame.p) - CFrame.new(Player.Character.Torso.CFrame.p, target.CFrame.p).p)
  2240. set = true
  2241. end
  2242. end
  2243. end
  2244. if set == false then
  2245. focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
  2246. end
  2247. wait()
  2248. end
  2249. if focus ~= nil then focus:Remove() focus = nil end
  2250. local cam = game:GetService("Workspace").CurrentCamera
  2251. cam.CameraSubject = Player.Character:FindFirstChild("Humanoid")
  2252. cam.CameraType = "Custom"
  2253. else
  2254. zoom = false
  2255. end
  2256. end
  2257. if key == "u" and Button1Down == false and canFire == true then
  2258. if automatic == false and burst == false then
  2259. if switchToBurst == true then
  2260. burst = true
  2261. local m = Instance.new("Message", Player)
  2262. m.Text = "Burst"
  2263. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  2264. delay(2.5, function() m:Remove() end)
  2265. elseif switchToAutomatic == true then
  2266. automatic = true
  2267. local m = Instance.new("Message", Player)
  2268. m.Text = "Automatic"
  2269. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  2270. delay(2.5, function() m:Remove() end)
  2271. end
  2272. elseif automatic == false and burst == true then
  2273. if switchToAutomatic == true then
  2274. automatic = true
  2275. burst = false
  2276. local m = Instance.new("Message", Player)
  2277. m.Text = "Automatic"
  2278. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  2279. delay(2.5, function() m:Remove() end)
  2280. elseif switchToSingle == true then
  2281. burst = false
  2282. local m = Instance.new("Message", Player)
  2283. m.Text = "Single"
  2284. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  2285. delay(2.5, function() m:Remove() end)
  2286. end
  2287. elseif automatic == true and burst == false then
  2288. if switchToSingle == true then
  2289. automatic = false
  2290. local m = Instance.new("Message", Player)
  2291. m.Text = "Single"
  2292. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  2293. delay(2.5, function() m:Remove() end)
  2294. elseif switchToBurst == true then
  2295. automatic = false
  2296. burst = true
  2297. local m = Instance.new("Message", Player)
  2298. m.Text = "Burst"
  2299. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  2300. delay(2.5, function() m:Remove() end)
  2301. end
  2302. end
  2303. end
  2304. if key == "c" and Button1Down == false and canFire == true then
  2305. if zoom == true then
  2306. onKeyDown("y", mouse)
  2307. else end
  2308. if magazine.Value ~= 0 then
  2309. canFire = false
  2310. burstCount = 0
  2311. playAnimation("bolt")
  2312. if magazine.Value ~= 0 then
  2313. Chambered = true
  2314. magazine.Value = magazine.Value - 1
  2315. updateGui()
  2316. else
  2317. Chambered = false
  2318. end
  2319.  
  2320. canFire = true
  2321. end
  2322. end
  2323. end
  2324.  
  2325.  
  2326. function onSelected(mouse)
  2327. if selected == true then return end
  2328. selected = true
  2329. canFire = false
  2330. mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
  2331. while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
  2332. if Player.Character.WeaponActivated.Value == nil then break end
  2333. if Player.Character.WeaponActivated.Value.Parent == nil then break end
  2334. wait()
  2335. end
  2336. updateGui()
  2337. local weapon = Instance.new("ObjectValue")
  2338. weapon.Name = "WeaponActivated"
  2339. weapon.Value = script.Parent
  2340. weapon.Parent = Player.Character
  2341. DisableLimb(1, Player.Character)
  2342. DisableLimb(2, Player.Character)
  2343. ForceAngle(1, 0, Player.Character)
  2344. ForceAngle(2, 0, Player.Character)
  2345. if dual == true then
  2346. coroutine.resume(coroutine.create(function() playAnimation("leftEquip") end))
  2347. playAnimation("rightEquip")
  2348. removeParts("LeftHolster")
  2349. makeParts("LeftHand")
  2350. else
  2351. playAnimation("equip")
  2352. end
  2353. removeParts("RightHolster")
  2354. makeParts("RightHand")
  2355. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  2356. mouse.Button1Up:connect(function() onButton1Up(mouse) end)
  2357. mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
  2358. mouse.Icon = "http://www.roblox.com/asset/?id=66839997"
  2359. canFire = true
  2360. end
  2361.  
  2362.  
  2363. function onDeselected(mouse)
  2364. if selected == false then return end
  2365. Button1Down = false
  2366. while canFire == false do
  2367. wait()
  2368. end
  2369. selected = false
  2370. if dual == true then
  2371. if math.random(1, 2) == 1 then
  2372. coroutine.resume(coroutine.create(function() playAnimation("leftUnequip") end))
  2373. wait(math.random(1, 10) / 10)
  2374. playAnimation("rightUnequip")
  2375. else
  2376. coroutine.resume(coroutine.create(function() playAnimation("rightUnequip") end))
  2377. wait(math.random(1, 10) / 10)
  2378. playAnimation("leftUnequip")
  2379. end
  2380. removeParts("LeftHand")
  2381. makeParts("LeftHolster")
  2382. else
  2383. playAnimation("unequip")
  2384. end
  2385. removeParts("RightHand")
  2386. makeParts("RightHolster")
  2387. ForceAngle(1, 0, Player.Character)
  2388. ForceAngle(2, 0, Player.Character)
  2389. ResetLimbCFrame(1, Player.Character)
  2390. ResetLimbCFrame(2, Player.Character)
  2391. EnableLimb(1, Player.Character)
  2392. EnableLimb(2, Player.Character)
  2393. if Player.PlayerGui:FindFirstChild(Name) ~= nil then Player.PlayerGui[Name]:Remove() end
  2394. if Player.Character:FindFirstChild("WeaponActivated") ~= nil then
  2395. if Player.Character.WeaponActivated.Value == script.Parent then
  2396. Player.Character.WeaponActivated:Remove()
  2397. end
  2398. end
  2399. while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
  2400. if Player.Character.WeaponActivated.Value == nil then break end
  2401. if Player.Character.WeaponActivated.Value.Parent == nil then break end
  2402. wait()
  2403. end
  2404. end
  2405.  
  2406.  
  2407. if script.Parent.ClassName ~= "HopperBin" then
  2408. if Player == nil then print("Error: Player not found!") return end
  2409. Tool = Instance.new("HopperBin")
  2410. Tool.Name = Name
  2411. Tool.Parent = Player.Backpack
  2412. script.Name = "Main"
  2413. script.Parent = Tool
  2414. end wait() if script.Parent.ClassName == "HopperBin" then
  2415. while script.Parent.Parent.ClassName ~= "Backpack" do
  2416. wait()
  2417. end
  2418. if script.Parent:FindFirstChild("MagazineMax") == nil then
  2419. magazineMax = Instance.new("NumberValue")
  2420. magazineMax.Name = "MagazineMax"
  2421. magazineMax.Value = 5
  2422. magazineMax.Parent = script.Parent
  2423. else
  2424. magazineMax = script.Parent.MagazineMax
  2425. end
  2426. if script.Parent:FindFirstChild("Magazine") == nil then
  2427. magazine = Instance.new("NumberValue")
  2428. magazine.Name = "Magazine"
  2429. magazine.Value = 0
  2430. magazine.Parent = script.Parent
  2431. else
  2432. magazine = script.Parent.Magazine
  2433. end
  2434. if script.Parent:FindFirstChild("AmmoMax") == nil then
  2435. ammoMax = Instance.new("NumberValue")
  2436. ammoMax.Name = "AmmoMax"
  2437. ammoMax.Value = 50
  2438. ammoMax.Parent = script.Parent
  2439. else
  2440. ammoMax = script.Parent.AmmoMax
  2441. end
  2442. if script.Parent:FindFirstChild("Ammo") == nil then
  2443. ammo = Instance.new("NumberValue")
  2444. ammo.Name = "Ammo"
  2445. ammo.Value = script.Parent.AmmoMax.Value
  2446. ammo.Parent = script.Parent
  2447. else
  2448. ammo = script.Parent.Ammo
  2449. end
  2450. Player = script.Parent.Parent.Parent
  2451. makeParts("RightHolster")
  2452. script.Parent.Selected:connect(onSelected)
  2453. script.Parent.Deselected:connect(onDeselected)
  2454. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement