Advertisement
Dinosaurus

[R] Yellow Sniper Script

Jun 17th, 2016
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 67.19 KB | None | 0 0
  1. :ls --[[
  2. Script shared by eletronix ]]
  3.  
  4. Player = script:FindFirstChild("Player") ~= nil and script.Player.Value or game.Players.LocalPlayer
  5. Name = "L96A1"
  6. MC = BrickColor.new("Yellow")
  7. DC = BrickColor.new("Yellow")
  8. GC = BrickColor.new("Yellow")
  9. BC = BrickColor.new("Yellow")
  10. MR = 0
  11. GR = 0
  12. HP = true
  13. selected = false
  14. canDual = false
  15. dual = false
  16. Button1Down = false
  17. damage = 95
  18. canFire = true
  19. canFire2 = false
  20. readyTime = 1.8
  21. automatic = false
  22. burst = false
  23. burstCount = 0
  24. burstCountMax = 2
  25. canSilence = true
  26. silenced = false
  27. canZoom = true
  28. zoom = false
  29. switchToSingle = true
  30. switchToBurst = true
  31. switchToAutomatic = true
  32.  
  33. ammoGui = Instance.new("ScreenGui")
  34. ammoGui.Name = Name
  35. local frame = Instance.new("Frame")
  36. frame.Name = "Frame"
  37. frame.Size = UDim2.new(0, 165, 0, 60)
  38. frame.Position = UDim2.new(0, 0, 1, -400)
  39. frame.BackgroundColor3 = Color3.new(1, 1, 1)
  40. frame.BorderColor3 = Color3.new(0, 0, 0)
  41. frame.Parent = ammoGui
  42. local label = Instance.new("TextLabel")
  43. label.Name = "Weapon"
  44. label.Text = "Weapon: " ..Name
  45. label.Size = UDim2.new(1, 0, 0, 20)
  46. label.Position = UDim2.new(0, 0, 0, 0)
  47. label.BackgroundColor3 = Color3.new(1, 0, 0)
  48. label.BorderColor3 = Color3.new(0, 0, 0)
  49. label.Parent = frame
  50. local label = Instance.new("TextLabel")
  51. label.Name = "MagazinePrefix"
  52. label.Text = " Magazine:"
  53. label.TextXAlignment = "Left"
  54. label.Size = UDim2.new(1, 0, 0, 20)
  55. label.Position = UDim2.new(0, 0, 0, 20)
  56. label.BackgroundColor3 = Color3.new(1, 1, 1)
  57. label.BorderColor3 = Color3.new(0, 0, 0)
  58. label.Parent = frame
  59. local label = Instance.new("TextLabel")
  60. label.Name = "Magazine"
  61. label.Text = "0/0"
  62. label.TextXAlignment = "Right"
  63. label.Size = UDim2.new(1, 0, 0, 20)
  64. label.Position = UDim2.new(0, -10, 0, 20)
  65. label.BackgroundTransparency = 1
  66. label.BorderSizePixel = 0
  67. label.Parent = frame
  68. local label = Instance.new("TextLabel")
  69. label.Name = "AmmoPrefix"
  70. label.Text = " Ammunition:"
  71. label.TextXAlignment = "Left"
  72. label.Size = UDim2.new(1, 0, 0, 20)
  73. label.Position = UDim2.new(0, 0, 0, 40)
  74. label.BackgroundColor3 = Color3.new(1, 1, 1)
  75. label.BorderColor3 = Color3.new(0, 0, 0)
  76. label.Parent = frame
  77. local label = Instance.new("TextLabel")
  78. label.Name = "Ammo"
  79. label.Text = "0/0"
  80. label.TextXAlignment = "Right"
  81. label.Size = UDim2.new(1, 0, 0, 20)
  82. label.Position = UDim2.new(0, -10, 0, 40)
  83. label.BackgroundTransparency = 1
  84. label.BorderSizePixel = 0
  85. label.Parent = frame
  86.  
  87. function updateGui()
  88. if selected == false then return end
  89. if Player:FindFirstChild("PlayerGui") == nil then Instance.new("PlayerGui").Parent = Player end
  90. if Player.PlayerGui:FindFirstChild(Name) == nil then
  91. ammoGui:Clone().Parent = Player.PlayerGui
  92. end
  93. Player.PlayerGui[Name].Frame.Magazine.Text = tostring(magazine.Value).. "/" ..tostring(magazineMax.Value)
  94. Player.PlayerGui[Name].Frame.Ammo.Text = tostring(ammo.Value).. "/" ..tostring(ammoMax.Value)
  95. end
  96.  
  97. function makeParts(format)
  98. local model = Instance.new("Model")
  99. model.Name = Name
  100. local pm = Instance.new("Part")
  101. pm.Name = "Handle"
  102. pm.formFactor = "Symmetric"
  103. pm.Size = Vector3.new(1, 1, 1)
  104. pm.BrickColor = GC
  105. pm.Reflectance = GR
  106. pm.CanCollide = false
  107. pm.Transparency = 1
  108. pm.Locked = true
  109. pm.TopSurface = 0
  110. pm.BottomSurface = 0
  111. pm.Parent = model
  112. local m = Instance.new("BlockMesh")
  113. m.Scale = Vector3.new(0.28, 1.1, 0.19)
  114. m.Offset = Vector3.new(0, -0.25, 0.07)
  115. m.Parent = pm
  116. if format ~= nil then
  117. local w = Instance.new("Weld")
  118. w.Part0 = pm
  119. if format == "RightHand" then
  120. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  121. w.C0 = CFrame.new(0, 1.15, 0.7)
  122. w.C1 = CFrame.new()
  123. elseif format == "RightHolster" then
  124. w.Part1 = Player.Character:FindFirstChild("Torso")
  125. w.C0 = CFrame.new(-0.66, -0.7, 0.3) * CFrame.fromEulerAnglesXYZ(math.rad(-135), math.rad(90), 0)
  126. w.C1 = CFrame.new()
  127. model.Name = Name.. " (Holstered)"
  128. end
  129. w.Parent = pm
  130. model.Parent = Player.Character
  131. end
  132. --[[
  133. sniper1 http://www.roblox.com/asset/?id=1868836
  134. equip http://www.roblox.com/asset/?id=13510737
  135. fire1 http://www.roblox.com/asset/?id=2760979
  136. fire2 http://www.roblox.com/asset/?id=13510352
  137. fire3 http://www.roblox.com/asset/?id=2692806
  138. fire4 http://www.roblox.com/asset/?id=2691586
  139. fire5 http://www.roblox.com/asset/?id=2920959
  140. fire6 http://www.roblox.com/asset/?id=2697431
  141. fire7 http://www.roblox.com/asset/?id=2920959
  142. reload1 http://www.roblox.com/asset/?id=2691591
  143. reload2 http://www.roblox.com/asset/?id=2697432
  144. reload3 http://www.roblox.com/asset/?id=2920960
  145. reload4 http://www.roblox.com/asset/?id=2761842
  146. shotgun1 http://www.roblox.com/asset/?id=2697294
  147. --]]
  148. local s = Instance.new("Sound")
  149. s.Name = "Fire"
  150. s.SoundId = "http://www.roblox.com/asset/?id=1868836"
  151. s.Volume = 1
  152. s.Pitch = 1
  153. s.Looped = false
  154. s.Parent = pm
  155. local s = Instance.new("Sound")
  156. s.Name = "Fire2"
  157. s.SoundId = "http://roblox.com/asset/?id=10209803"
  158. s.Volume = 1
  159. s.Pitch = 1.4
  160. s.Looped = false
  161. s.Parent = pm
  162. local s = Instance.new("Sound")
  163. s.Name = "Equip"
  164. s.SoundId = "http://www.roblox.com/asset/?id=10209881"
  165. s.Volume = 1
  166. s.Pitch = 0.6
  167. s.Looped = false
  168. s.Parent = pm
  169. local s = Instance.new("Sound")
  170. s.Name = "Reload"
  171. s.SoundId = "http://www.roblox.com/asset/?id=2761842"
  172. s.Volume = 1
  173. s.Pitch = 1.2
  174. s.Looped = false
  175. s.Parent = pm
  176. local s = Instance.new("Sound")
  177. s.Name = "Empty"
  178. s.SoundId = "http://www.roblox.com/asset/?id=2697295"
  179. s.Volume = 1
  180. s.Pitch = 5
  181. s.Looped = false
  182. s.Parent = pm
  183. local s = Instance.new("Sound")
  184. s.Name = "Switch"
  185. s.SoundId = "http://www.roblox.com/asset/?id=2697295"
  186. s.Volume = 1
  187. s.Pitch = 10
  188. s.Looped = false
  189. s.Parent = pm
  190. local p = Instance.new("Part")
  191. p.Name = "ShellOut"
  192. p.formFactor = "Custom"
  193. p.Size = Vector3.new(0.2, 0.2, 0.2)
  194. p.Transparency = 1
  195. p.Locked = true
  196. p.CanCollide = false
  197. p.TopSurface = 0
  198. p.BottomSurface = 0
  199. p.Parent = model
  200. local w = Instance.new("Weld")
  201. w.Part0 = p
  202. w.Part1 = pm
  203. w.C0 = CFrame.new(-0.06, 0.62, -0.06) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  204. w.C1 = CFrame.new()
  205. w.Parent = p--]]
  206. local p = Instance.new("Part")
  207. p.Name = "Grip"
  208. p.formFactor = "Symmetric"
  209. p.Size = Vector3.new(1, 1, 1)
  210. p.BrickColor = GC
  211. p.Reflectance = GR
  212. p.CanCollide = false
  213. p.Locked = true
  214. p.TopSurface = 0
  215. p.BottomSurface = 0
  216. p.Parent = model
  217. local m = Instance.new("BlockMesh")
  218. m.Scale = Vector3.new(0.3, 0.38, 0.8)
  219. m.Parent = p
  220. local w = Instance.new("Weld")
  221. w.Part0 = p
  222. w.Part1 = pm
  223. w.C0 = CFrame.new(0, -0.15, -0.5) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
  224. w.C1 = CFrame.new()
  225. w.Parent = p
  226. local p = Instance.new("Part")
  227. p.Name = "GripWood"
  228. p.formFactor = "Symmetric"
  229. p.Size = Vector3.new(1, 1, 1)
  230. p.BrickColor = DC
  231. p.Reflectance = MR
  232. p.CanCollide = false
  233. p.Locked = true
  234. p.TopSurface = 0
  235. p.BottomSurface = 0
  236. p.Parent = model
  237. local m = Instance.new("SpecialMesh")
  238. m.MeshType = "Brick"
  239. m.Scale = Vector3.new(0.36, 0.36, 0.6)
  240. m.Parent = p
  241. local w = Instance.new("Weld")
  242. w.Part0 = p
  243. w.Part1 = pm
  244. w.C0 = CFrame.new(0, -0.15, -0.56) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
  245. w.C1 = CFrame.new()
  246. w.Parent = p--]]
  247. local p = Instance.new("Part")
  248. p.Name = "Magazine"
  249. p.formFactor = "Symmetric"
  250. p.Size = Vector3.new(1, 1, 1)
  251. p.BrickColor = DC
  252. p.Reflectance = MR
  253. p.CanCollide = false
  254. p.Locked = true
  255. p.TopSurface = 0
  256. p.BottomSurface = 0
  257. p.Parent = model
  258. local m = Instance.new("BlockMesh")
  259. m.Scale = Vector3.new(0.25, 0.5, 0.5)
  260. m.Parent = p
  261. local w = Instance.new("Weld")
  262. w.Part0 = p
  263. w.Part1 = pm
  264. w.C0 = CFrame.new(0, 0.5, -0.24)
  265. w.C1 = CFrame.new()
  266. w.Parent = p
  267. local p = Instance.new("Part")
  268. p.Name = "Trigger Housing"
  269. p.formFactor = "Symmetric"
  270. p.Size = Vector3.new(1, 1, 1)
  271. p.BrickColor = MC
  272. p.Reflectance = MR
  273. p.CanCollide = false
  274. p.Locked = true
  275. p.TopSurface = 0
  276. p.BottomSurface = 0
  277. p.Parent = model
  278. local m = Instance.new("BlockMesh")
  279. m.Scale = Vector3.new(0.2, 0.4, 0.04)
  280. m.Parent = p
  281. local w = Instance.new("Weld")
  282. w.Part0 = p
  283. w.Part1 = pm
  284. w.C0 = CFrame.new(0, 0.1, -0.36)
  285. w.C1 = CFrame.new()
  286. w.Parent = p
  287. local p = Instance.new("Part")
  288. p.Name = "Trigger"
  289. p.formFactor = "Symmetric"
  290. p.Size = Vector3.new(1, 1, 1)
  291. p.BrickColor = BrickColor.new("Dark stone grey")
  292. p.Reflectance = MR
  293. p.CanCollide = false
  294. p.Locked = true
  295. p.TopSurface = 0
  296. p.BottomSurface = 0
  297. p.Parent = model
  298. local m = Instance.new("BlockMesh")
  299. m.Scale = Vector3.new(0.18, 0.18, 0.18)
  300. m.Parent = p
  301. local w = Instance.new("Weld")
  302. w.Part0 = p
  303. w.Part1 = pm
  304. w.C0 = CFrame.new(0, 0.02, -0.25)
  305. w.C1 = CFrame.new()
  306. w.Parent = p
  307. local p = Instance.new("Part")
  308. p.Name = "Body1" --------------
  309. p.CanCollide = false
  310. p.formFactor = "Symmetric"
  311. p.Size = Vector3.new(1, 1, 1)
  312. p.BrickColor = GC
  313. p.Reflectance = GR
  314. p.Locked = true
  315. p.TopSurface = 0
  316. p.BottomSurface = 0
  317. p.Parent = model
  318. local m = Instance.new("BlockMesh")
  319. m.Scale = Vector3.new(0.3, 2, 0.38)
  320. m.Parent = p
  321. local w = Instance.new("Weld")
  322. w.Part0 = p
  323. w.Part1 = pm
  324. w.C0 = CFrame.new(0, 1.2, -0.12)
  325. w.C1 = CFrame.new()
  326. w.Parent = p
  327. local p = Instance.new("Part")
  328. p.Name = "Body2"
  329. p.CanCollide = false
  330. p.formFactor = "Symmetric"
  331. p.Size = Vector3.new(1, 1, 1)
  332. p.BrickColor = DC
  333. p.Reflectance = MR
  334. p.Locked = true
  335. p.TopSurface = 0
  336. p.BottomSurface = 0
  337. p.Parent = model
  338. local m = Instance.new("SpecialMesh")
  339. m.MeshType = "Brick"
  340. m.Scale = Vector3.new(0.32, 1.4, 0.2)
  341. m.Parent = p
  342. local w = Instance.new("Weld")
  343. w.Part0 = p
  344. w.Part1 = pm
  345. w.C0 = CFrame.new(0, 1.48, -0.08)
  346. w.C1 = CFrame.new()
  347. w.Parent = p
  348. local p = Instance.new("Part")
  349. p.Name = "GripAngle1"
  350. p.CanCollide = false
  351. p.formFactor = "Symmetric"
  352. p.Size = Vector3.new(1, 1, 1)
  353. p.BrickColor = GC
  354. p.Reflectance = GR
  355. p.Locked = true
  356. p.TopSurface = 0
  357. p.BottomSurface = 0
  358. p.Parent = model
  359. local m = Instance.new("SpecialMesh")
  360. m.MeshType = "Wedge"
  361. m.Scale = Vector3.new(0.3, 0.14, 0.6)
  362. m.Parent = p
  363. local w = Instance.new("Weld")
  364. w.Part0 = p
  365. w.Part1 = pm
  366. w.C0 = CFrame.new(0, -0.38, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180))
  367. w.C1 = CFrame.new()
  368. w.Parent = p
  369. local p = Instance.new("Part")
  370. p.Name = "GripAngle2"
  371. p.CanCollide = false
  372. p.formFactor = "Symmetric"
  373. p.Size = Vector3.new(1, 1, 1)
  374. p.BrickColor = GC
  375. p.Reflectance = GR
  376. p.Locked = true
  377. p.TopSurface = 0
  378. p.BottomSurface = 0
  379. p.Parent = model
  380. local m = Instance.new("SpecialMesh")
  381. m.MeshType = "Wedge"
  382. m.Scale = Vector3.new(0.3, 0.06, 0.8)
  383. m.Parent = p
  384. local w = Instance.new("Weld")
  385. w.Part0 = p
  386. w.Part1 = pm
  387. w.C0 = CFrame.new(0, -0.34, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180))
  388. w.C1 = CFrame.new()
  389. w.Parent = p
  390. local p = Instance.new("Part")
  391. p.Name = "GripTrigHous"
  392. p.formFactor = "Symmetric"
  393. p.Size = Vector3.new(1, 1, 1)
  394. p.BrickColor = GC
  395. p.Reflectance = GR
  396. p.CanCollide = false
  397. p.Locked = true
  398. p.TopSurface = 0
  399. p.BottomSurface = 0
  400. p.Parent = model
  401. local m = Instance.new("BlockMesh")
  402. m.Scale = Vector3.new(0.3, 0.4, 0.1)
  403. m.Parent = p
  404. local w = Instance.new("Weld")
  405. w.Part0 = p
  406. w.Part1 = pm
  407. w.C0 = CFrame.new(0, 0, -0.4)
  408. w.C1 = CFrame.new()
  409. w.Parent = p
  410. local p = Instance.new("Part")
  411. p.Name = "GripCover"
  412. p.formFactor = "Symmetric"
  413. p.Size = Vector3.new(1, 1, 1)
  414. p.BrickColor = GC
  415. p.Reflectance = GR
  416. p.CanCollide = false
  417. p.Locked = true
  418. p.TopSurface = 0
  419. p.BottomSurface = 0
  420. p.Parent = model
  421. local m = Instance.new("BlockMesh")
  422. m.Scale = Vector3.new(0.3, 1, 0.3)
  423. m.Parent = p
  424. local w = Instance.new("Weld")
  425. w.Part0 = p
  426. w.Part1 = pm
  427. w.C0 = CFrame.new(0, 0.1, -0.08)
  428. w.C1 = CFrame.new()
  429. w.Parent = p
  430. local p = Instance.new("Part")
  431. p.Name = "BoltBlock" --------------
  432. p.CanCollide = false
  433. p.formFactor = "Symmetric"
  434. p.Size = Vector3.new(1, 1, 1)
  435. p.BrickColor = DC
  436. p.Reflectance = MR
  437. p.Locked = true
  438. p.TopSurface = 0
  439. p.BottomSurface = 0
  440. p.Parent = model
  441. local m = Instance.new("SpecialMesh")
  442. m.MeshType = "Brick"
  443. m.Scale = Vector3.new(0.28, 1, 0.3)
  444. m.Parent = p
  445. local w = Instance.new("Weld")
  446. w.Part0 = p
  447. w.Part1 = pm
  448. w.C0 = CFrame.new(0, 0.3, 0.06)
  449. w.C1 = CFrame.new()
  450. w.Parent = p
  451. local p = Instance.new("Part")
  452. p.Name = "BoltShaftI"
  453. p.formFactor = "Symmetric"
  454. p.Size = Vector3.new(1, 1, 1)
  455. p.BrickColor = BC
  456. p.Reflectance = MR
  457. p.Transparency = 0
  458. p.CanCollide = false
  459. p.Locked = true
  460. p.TopSurface = 0
  461. p.BottomSurface = 0
  462. p.Parent = model
  463. local m = Instance.new("SpecialMesh")
  464. m.MeshType = "Brick"
  465. m.Scale = Vector3.new(0.26, 1, 0.26)
  466. m.Parent = p
  467. local w = Instance.new("Weld")
  468. w.Part0 = p
  469. w.Part1 = pm
  470. w.C0 = CFrame.new(0, 0.06, 0.06)
  471. w.C1 = CFrame.new()
  472. w.Parent = p
  473. local p = Instance.new("Part")
  474. p.Name = "BoltKnobI"
  475. p.CanCollide = false
  476. p.formFactor = "Symmetric"
  477. p.Size = Vector3.new(1, 1, 1)
  478. p.BrickColor = BC
  479. p.Reflectance = MR
  480. p.Transparency = 0
  481. p.Locked = true
  482. p.TopSurface = 0
  483. p.BottomSurface = 0
  484. p.Parent = model
  485. local m = Instance.new("SpecialMesh")
  486. m.MeshType = "Brick"
  487. m.Scale = Vector3.new(0.3, 0.14, 0.14)
  488. m.Parent = p
  489. local w = Instance.new("Weld")
  490. w.Part0 = p
  491. w.Part1 = pm
  492. w.C0 = CFrame.new(0.2, -0.3, 0.06)
  493. w.C1 = CFrame.new()
  494. w.Parent = p
  495. local p = Instance.new("Part")
  496. p.Name = "BoltShaftO"
  497. p.formFactor = "Symmetric"
  498. p.Size = Vector3.new(1, 1, 1)
  499. p.BrickColor = BC
  500. p.Reflectance = MR
  501. p.Transparency = 1
  502. p.CanCollide = false
  503. p.Locked = true
  504. p.TopSurface = 0
  505. p.BottomSurface = 0
  506. p.Parent = model
  507. local m = Instance.new("SpecialMesh")
  508. m.MeshType = "Brick"
  509. m.Scale = Vector3.new(0.26, 1, 0.26)
  510. m.Parent = p
  511. local w = Instance.new("Weld")
  512. w.Part0 = p
  513. w.Part1 = pm
  514. w.C0 = CFrame.new(0, -0.06, 0.06)
  515. w.C1 = CFrame.new()
  516. w.Parent = p
  517. local p = Instance.new("Part")
  518. p.Name = "BoltKnobO"
  519. p.CanCollide = false
  520. p.formFactor = "Symmetric"
  521. p.Size = Vector3.new(1, 1, 1)
  522. p.BrickColor = BC
  523. p.Reflectance = MR
  524. p.Transparency = 1
  525. p.Locked = true
  526. p.TopSurface = 0
  527. p.BottomSurface = 0
  528. p.Parent = model
  529. local m = Instance.new("SpecialMesh")
  530. m.MeshType = "Brick"
  531. m.Scale = Vector3.new(0.3, 0.14, 0.14)
  532. m.Parent = p
  533. local w = Instance.new("Weld")
  534. w.Part0 = p
  535. w.Part1 = pm
  536. w.C0 = CFrame.new(0.2, -0.4, 0.06)
  537. w.C1 = CFrame.new()
  538. w.Parent = p
  539. local p = Instance.new("Part")
  540. p.Name = "Barrel 1"
  541. p.formFactor = "Symmetric"
  542. p.Size = Vector3.new(1, 1, 1)
  543. p.BrickColor = DC
  544. p.Reflectance = MR
  545. p.CanCollide = false
  546. p.Locked = true
  547. p.TopSurface = 0
  548. p.BottomSurface = 0
  549. p.Parent = model
  550. local m = Instance.new("CylinderMesh")
  551. m.Scale = Vector3.new(0.2, 4, 0.2)
  552. m.Parent = p
  553. local w = Instance.new("Weld")
  554. w.Part0 = p
  555. w.Part1 = pm
  556. w.C0 = CFrame.new(0, 2.6, 0.06)
  557. w.C1 = CFrame.new()
  558. w.Parent = p
  559. local p = Instance.new("Part")
  560. p.Name = "Muzzle"
  561. p.formFactor = "Symmetric"
  562. p.Size = Vector3.new(1, 1, 1)
  563. p.BrickColor = DC
  564. p.Reflectance = MR
  565. p.CanCollide = false
  566. p.Locked = true
  567. p.TopSurface = 0
  568. p.BottomSurface = 0
  569. p.Parent = model
  570. local m = Instance.new("CylinderMesh")
  571. m.Scale = Vector3.new(0.24, 0.8, 0.24)
  572. m.Parent = p
  573. local w = Instance.new("Weld")
  574. w.Part0 = p
  575. w.Part1 = pm
  576. w.C0 = CFrame.new(0, 4.2, 0.06)
  577. w.C1 = CFrame.new()
  578. w.Parent = p
  579. local s = Instance.new("Smoke")
  580. s.Enabled = false
  581. s.Name = "Smoke"
  582. s.RiseVelocity = -5
  583. s.Opacity = 0.5
  584. s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225)
  585. s.Size = 2.4
  586. s.Parent = p
  587. local f = Instance.new("Fire")
  588. f.Enabled = false
  589. f.Name = "Fire"
  590. f.Heat = -20
  591. f.Size = 3.6
  592. f.Parent = p
  593. local p = Instance.new("Part")
  594. p.Name = "MuzzleHole"
  595. p.formFactor = "Symmetric"
  596. p.Size = Vector3.new(1, 1, 1)
  597. p.BrickColor = BrickColor.new("Really black")
  598. p.Reflectance = MR
  599. p.CanCollide = false
  600. p.Locked = true
  601. p.TopSurface = 0
  602. p.BottomSurface = 0
  603. p.Parent = model
  604. local m = Instance.new("CylinderMesh")
  605. m.Scale = Vector3.new(0.18, 0.8, 0.18)
  606. m.Parent = p
  607. local w = Instance.new("Weld")
  608. w.Part0 = p
  609. w.Part1 = pm
  610. w.C0 = CFrame.new(0, 4.203, 0.06)
  611. w.C1 = CFrame.new()
  612. w.Parent = p
  613. local p = Instance.new("Part")
  614. p.Name = "Silencer"
  615. p.formFactor = "Symmetric"
  616. p.Size = Vector3.new(1, 1, 1)
  617. p.BrickColor = BrickColor.new("Black")
  618. p.CanCollide = false
  619. p.Transparency = 1
  620. p.Locked = true
  621. p.TopSurface = 0
  622. p.BottomSurface = 0
  623. p.Parent = model
  624. local m = Instance.new("CylinderMesh")
  625. m.Scale = Vector3.new(0.28, 3, 0.28)
  626. m.Parent = p
  627. local w = Instance.new("Weld")
  628. w.Part0 = p
  629. w.Part1 = pm
  630. w.C0 = CFrame.new(0, 4, 0.06)
  631. w.C1 = CFrame.new()
  632. w.Parent = p
  633. local p = Instance.new("Part")
  634. p.Name = "GripStock"
  635. p.formFactor = "Symmetric"
  636. p.Size = Vector3.new(1, 1, 1)
  637. p.BrickColor = GC
  638. p.Reflectance = GR
  639. p.CanCollide = false
  640. p.Locked = true
  641. p.TopSurface = 0
  642. p.BottomSurface = 0
  643. p.Parent = model
  644. local m = Instance.new("BlockMesh")
  645. m.Scale = Vector3.new(0.3, 0.8, 0.3)
  646. m.Parent = p
  647. local w = Instance.new("Weld")
  648. w.Part0 = p
  649. w.Part1 = pm
  650. w.C0 = CFrame.new(0, -0.6, -0.75) * CFrame.fromEulerAnglesXYZ(math.rad(20), 0, 0)
  651. w.C1 = CFrame.new()
  652. w.Parent = p
  653. local p = Instance.new("Part") -- Standard Stock
  654. p.Name = "StockT"
  655. p.CanCollide = false
  656. p.formFactor = "Symmetric"
  657. p.Size = Vector3.new(1, 1, 1)
  658. p.BrickColor = GC
  659. p.Reflectance = GR
  660. p.Locked = true
  661. p.TopSurface = 0
  662. p.BottomSurface = 0
  663. p.Parent = model
  664. local m = Instance.new("BlockMesh")
  665. m.Scale = Vector3.new(0.3, 1.4, 0.25)
  666. m.Parent = p
  667. local w = Instance.new("Weld")
  668. w.Part0 = p
  669. w.Part1 = pm
  670. w.C0 = CFrame.new(0, -0.6, -0.1)
  671. w.C1 = CFrame.new()
  672. w.Parent = p
  673. local p = Instance.new("Part")
  674. p.Name = "CheekRest" --------------
  675. p.CanCollide = false
  676. p.formFactor = "Symmetric"
  677. p.Size = Vector3.new(1, 1, 1)
  678. p.BrickColor = DC
  679. p.Reflectance = MR
  680. p.Locked = true
  681. p.TopSurface = 0
  682. p.BottomSurface = 0
  683. p.Parent = model
  684. local m = Instance.new("SpecialMesh")
  685. m.MeshType = "Brick"
  686. m.Scale = Vector3.new(0.26, 0.6, 0.3)
  687. m.Parent = p
  688. local w = Instance.new("Weld")
  689. w.Part0 = p
  690. w.Part1 = pm
  691. w.C0 = CFrame.new(0, -0.84, -0.04)
  692. w.C1 = CFrame.new()
  693. w.Parent = p
  694. local p = Instance.new("Part")
  695. p.Name = "Stock1"
  696. p.CanCollide = false
  697. p.formFactor = "Symmetric"
  698. p.Size = Vector3.new(1, 1, 1)
  699. p.BrickColor = DC
  700. p.Reflectance = MR
  701. p.Locked = true
  702. p.TopSurface = 0
  703. p.BottomSurface = 0
  704. p.Parent = model
  705. local m = Instance.new("BlockMesh")
  706. m.Scale = Vector3.new(0.34, 0.4, 0.7)
  707. m.Parent = p
  708. local w = Instance.new("Weld")
  709. w.Part0 = p
  710. w.Part1 = pm
  711. w.C0 = CFrame.new(0, -1.38, -0.3) --* CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180))
  712. w.C1 = CFrame.new()
  713. w.Parent = p
  714. local p = Instance.new("Part")
  715. p.Name = "Stock2"
  716. p.CanCollide = false
  717. p.formFactor = "Symmetric"
  718. p.Size = Vector3.new(1, 1, 1)
  719. p.BrickColor = GC
  720. p.Reflectance = GR
  721. p.Locked = true
  722. p.TopSurface = 0
  723. p.BottomSurface = 0
  724. p.Parent = model
  725. local m = Instance.new("BlockMesh")
  726. m.Scale = Vector3.new(0.3, 0.4, 0.5)
  727. m.Parent = p
  728. local w = Instance.new("Weld")
  729. w.Part0 = p
  730. w.Part1 = pm
  731. w.C0 = CFrame.new(0, -0.38, -1) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180))
  732. w.C1 = CFrame.new()
  733. w.Parent = p--]]
  734. local p = Instance.new("Part") -------------- SCOPE
  735. p.Name = "Scope Base"
  736. p.formFactor = "Symmetric"
  737. p.CanCollide = false
  738. p.Size = Vector3.new(1, 1, 1)
  739. p.BrickColor = DC
  740. p.Reflectance = MR
  741. p.Locked = true
  742. p.TopSurface = 0
  743. p.BottomSurface = 0
  744. p.Parent = model
  745. local m = Instance.new("BlockMesh")
  746. m.Scale = Vector3.new(0.1, 0.14, 0.4)
  747. m.Parent = p
  748. local w = Instance.new("Weld")
  749. w.Part0 = p
  750. w.Part1 = pm
  751. w.C0 = CFrame.new(0, 0.1, 0.18)
  752. w.C1 = CFrame.new()
  753. w.Parent = p
  754. local p = Instance.new("Part")
  755. p.Name = "Scope Base"
  756. p.formFactor = "Symmetric"
  757. p.CanCollide = false
  758. p.Size = Vector3.new(1, 1, 1)
  759. p.BrickColor = DC
  760. p.Reflectance = MR
  761. p.Locked = true
  762. p.TopSurface = 0
  763. p.BottomSurface = 0
  764. p.Parent = model
  765. local m = Instance.new("BlockMesh")
  766. m.Scale = Vector3.new(0.1, 0.14, 0.4)
  767. m.Parent = p
  768. local w = Instance.new("Weld")
  769. w.Part0 = p
  770. w.Part1 = pm
  771. w.C0 = CFrame.new(0, 0.48, 0.18)
  772. w.C1 = CFrame.new()
  773. w.Parent = p
  774. local p = Instance.new("Part")
  775. p.Name = "Scope End 1" --End = Back
  776. p.CanCollide = false
  777. p.formFactor = "Symmetric"
  778. p.Size = Vector3.new(1, 1, 1)
  779. p.BrickColor = DC
  780. p.Reflectance = MR
  781. p.Locked = true
  782. p.TopSurface = 0
  783. p.BottomSurface = 0
  784. p.Parent = model
  785. local m = Instance.new("CylinderMesh")
  786. m.Scale = Vector3.new(0.24, 0.375, 0.24)
  787. m.Parent = p
  788. local w = Instance.new("Weld")
  789. w.Part0 = p
  790. w.Part1 = pm
  791. w.C0 = CFrame.new(0, -0.2, 0.38)
  792. w.C1 = CFrame.new()
  793. w.Parent = p
  794. local p = Instance.new("Part")
  795. p.Name = "Scope Center 1"
  796. p.CanCollide = false
  797. p.formFactor = "Symmetric"
  798. p.Size = Vector3.new(1, 1, 1)
  799. p.BrickColor = DC
  800. p.Reflectance = MR
  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.2, 0.8, 0.2)
  807. m.Parent = p
  808. local w = Instance.new("Weld")
  809. w.Part0 = p
  810. w.Part1 = pm
  811. w.C0 = CFrame.new(0, 0.3, 0.38)
  812. w.C1 = CFrame.new()
  813. w.Parent = p
  814. local p = Instance.new("Part")
  815. p.Name = "Scope Front 1"
  816. p.CanCollide = false
  817. p.formFactor = "Symmetric"
  818. p.Size = Vector3.new(1, 1, 1)
  819. p.BrickColor = DC
  820. p.Reflectance = MR
  821. p.Locked = true
  822. p.TopSurface = 0
  823. p.BottomSurface = 0
  824. p.Parent = model
  825. local m = Instance.new("CylinderMesh")
  826. m.Scale = Vector3.new(0.28, 0.7, 0.28)
  827. m.Parent = p
  828. local w = Instance.new("Weld")
  829. w.Part0 = p
  830. w.Part1 = pm
  831. w.C0 = CFrame.new(0, 0.94, 0.38)
  832. w.C1 = CFrame.new()
  833. w.Parent = p
  834. local p = Instance.new("Part")
  835. p.Name = "Scope Window F"
  836. p.CanCollide = false
  837. p.formFactor = "Symmetric"
  838. p.Size = Vector3.new(1, 1, 1)
  839. p.BrickColor = BrickColor.new("White")
  840. p.Reflectance = 0.3
  841. p.Locked = true
  842. p.TopSurface = 0
  843. p.BottomSurface = 0
  844. p.Parent = model
  845. local m = Instance.new("CylinderMesh")
  846. m.Scale = Vector3.new(0.27, 0.7, 0.27)
  847. m.Offset = Vector3.new(0, -0.003 ,0)
  848. m.Parent = p
  849. local w = Instance.new("Weld")
  850. w.Part0 = p
  851. w.Part1 = pm
  852. w.C0 = CFrame.new(0, 0.94, 0.38)
  853. w.C1 = CFrame.new()
  854. w.Parent = p
  855. local p = Instance.new("Part")
  856. p.Name = "Scope Window B"
  857. p.CanCollide = false
  858. p.formFactor = "Symmetric"
  859. p.Size = Vector3.new(1, 1, 1)
  860. p.BrickColor = BrickColor.new("White")
  861. p.Reflectance = 0.3
  862. p.Locked = true
  863. p.TopSurface = 0
  864. p.BottomSurface = 0
  865. p.Parent = model
  866. local m = Instance.new("CylinderMesh")
  867. m.Scale = Vector3.new(0.23, 0.375, 0.23)
  868. m.Offset = Vector3.new(0, 0.003 ,0)
  869. m.Parent = p
  870. local w = Instance.new("Weld")
  871. w.Part0 = p
  872. w.Part1 = pm
  873. w.C0 = CFrame.new(0, -0.2, 0.38)
  874. w.C1 = CFrame.new()
  875. w.Parent = p--]]
  876. local p = Instance.new("Part") ---Bipod
  877. p.Name = "BipodM" --------------
  878. p.CanCollide = false
  879. p.formFactor = "Symmetric"
  880. p.Size = Vector3.new(1, 1, 1)
  881. p.BrickColor = DC
  882. p.Reflectance = MR
  883. p.Locked = true
  884. p.TopSurface = 0
  885. p.BottomSurface = 0
  886. p.Parent = model
  887. local m = Instance.new("BlockMesh")
  888. m.Scale = Vector3.new(0.17, 0.25, 0.2)
  889. m.Parent = p
  890. local w = Instance.new("Weld")
  891. w.Part0 = p
  892. w.Part1 = pm
  893. w.C0 = CFrame.new(0, 2, -0.35)
  894. w.C1 = CFrame.new()
  895. w.Parent = p
  896. local p = Instance.new("Part")
  897. p.Name = "BipodArm"
  898. p.formFactor = "Symmetric"
  899. p.Size = Vector3.new(1, 1, 1)
  900. p.CanCollide = false
  901. p.BrickColor = DC
  902. p.Reflectance = MR
  903. p.Locked = true
  904. p.TopSurface = 0
  905. p.BottomSurface = 0
  906. p.Parent = model
  907. local m = Instance.new("CylinderMesh")
  908. m.Scale = Vector3.new(0.15, 1, 0.15)
  909. m.Offset = Vector3.new(0, -0.44 ,0)
  910. m.Parent = p
  911. local w = Instance.new("Weld")
  912. w.Part0 = p
  913. w.Part1 = pm
  914. w.C0 = CFrame.new(-0.09, 2, -0.4)
  915. w.C1 = CFrame.new()
  916. w.Parent = p
  917. local p = Instance.new("Part")
  918. p.Name = "BipodArm"
  919. p.formFactor = "Symmetric"
  920. p.Size = Vector3.new(1, 1, 1)
  921. p.CanCollide = false
  922. p.BrickColor = DC
  923. p.Reflectance = MR
  924. p.Locked = true
  925. p.TopSurface = 0
  926. p.BottomSurface = 0
  927. p.Parent = model
  928. local m = Instance.new("CylinderMesh")
  929. m.Scale = Vector3.new(0.15, 1, 0.15)
  930. m.Offset = Vector3.new(0, -0.44 ,0)
  931. m.Parent = p
  932. local w = Instance.new("Weld")
  933. w.Part0 = p
  934. w.Part1 = pm
  935. w.C0 = CFrame.new(0.09, 2, -0.4)
  936. w.C1 = CFrame.new()
  937. w.Parent = p--]]
  938. return model
  939. end
  940.  
  941. function removeParts(format)
  942. if format == "RightHand" then
  943. pcall(function() Player.Character[Name]:Remove() end)
  944. elseif format == "LeftHand" then
  945. pcall(function() Player.Character[Name.. " (Left)"]:Remove() end)
  946. elseif format == "RightHolster" then
  947. pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end)
  948. elseif format == "LeftHolster" then
  949. pcall(function() Player.Character[Name.. " (Holstered, Left)"]:Remove() end)
  950. end
  951. end
  952.  
  953. function SetAngle(Joint, Angle, Character)
  954. if Character == nil then return false end
  955. local Joints = {
  956. Character.Torso:FindFirstChild("Right Shoulder 2"),
  957. Character.Torso:FindFirstChild("Left Shoulder 2"),
  958. Character.Torso:FindFirstChild("Right Hip 2"),
  959. Character.Torso:FindFirstChild("Left Hip 2")
  960. }
  961. if Joints[Joint] == nil then return false end
  962. if Joint == 1 or Joint == 3 then
  963. Joints[Joint].DesiredAngle = Angle
  964. end
  965. if Joint == 2 or Joint == 4 then
  966. Joints[Joint].DesiredAngle = -Angle
  967. end
  968. end
  969.  
  970. function ForceAngle(Joint, Angle, Character)
  971. if Character == nil then return false end
  972. local Joints = {
  973. Character.Torso:FindFirstChild("Right Shoulder 2"),
  974. Character.Torso:FindFirstChild("Left Shoulder 2"),
  975. Character.Torso:FindFirstChild("Right Hip 2"),
  976. Character.Torso:FindFirstChild("Left Hip 2")
  977. }
  978. if Joints[Joint] == nil then return false end
  979. if Joint == 1 or Joint == 3 then
  980. Joints[Joint].DesiredAngle = Angle
  981. Joints[Joint].CurrentAngle = Angle
  982. end
  983. if Joint == 2 or Joint == 4 then
  984. Joints[Joint].DesiredAngle = -Angle
  985. Joints[Joint].CurrentAngle = -Angle
  986. end
  987. end
  988.  
  989. function SetSpeed(Joint, Speed, Character)
  990. if Character == nil then return false end
  991. local Joints = {
  992. Character.Torso:FindFirstChild("Right Shoulder 2"),
  993. Character.Torso:FindFirstChild("Left Shoulder 2"),
  994. Character.Torso:FindFirstChild("Right Hip 2"),
  995. Character.Torso:FindFirstChild("Left Hip 2")
  996. }
  997. if Joints[Joint] == nil then return false end
  998. Joints[Joint].MaxVelocity = Speed
  999. end
  1000.  
  1001. function DisableLimb(Limb, Character)
  1002. if Character == nil then return false end
  1003. if Character:FindFirstChild("Torso") == nil then return false end
  1004. local Joints = {
  1005. Character.Torso:FindFirstChild("Right Shoulder"),
  1006. Character.Torso:FindFirstChild("Left Shoulder"),
  1007. Character.Torso:FindFirstChild("Right Hip"),
  1008. Character.Torso:FindFirstChild("Left Hip")
  1009. }
  1010. local Limbs = {
  1011. Character:FindFirstChild("Right Arm"),
  1012. Character:FindFirstChild("Left Arm"),
  1013. Character:FindFirstChild("Right Leg"),
  1014. Character:FindFirstChild("Left Leg")
  1015. }
  1016. if Joints[Limb] == nil then return false end
  1017. if Limbs[Limb] == nil then return false end
  1018. local Joint = Instance.new("Motor")
  1019. Joint.Parent = Character.Torso
  1020. Joint.Part0 = Character.Torso
  1021. Joint.Part1 = Limbs[Limb]
  1022. if Limb == 1 then
  1023. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1024. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1025. Joint.Name = "Right Shoulder 2"
  1026. elseif Limb == 2 then
  1027. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1028. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1029. Joint.Name = "Left Shoulder 2"
  1030. elseif Limb == 3 then
  1031. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1032. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1033. Joint.Name = "Right Hip 2"
  1034. elseif Limb == 4 then
  1035. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1036. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1037. Joint.Name = "Left Hip 2"
  1038. end
  1039. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  1040. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  1041. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  1042. Joints[Limb]:Remove()
  1043. end
  1044.  
  1045. function ResetLimbCFrame(Limb, Character)
  1046. if Character == nil then return false end
  1047. if Character.Parent == nil then return false end
  1048. if Character:FindFirstChild("Torso") == nil then return false end
  1049. local Joints = {
  1050. Character.Torso:FindFirstChild("Right Shoulder 2"),
  1051. Character.Torso:FindFirstChild("Left Shoulder 2"),
  1052. Character.Torso:FindFirstChild("Right Hip 2"),
  1053. Character.Torso:FindFirstChild("Left Hip 2")
  1054. }
  1055. local Limbs = {
  1056. Character:FindFirstChild("Right Arm"),
  1057. Character:FindFirstChild("Left Arm"),
  1058. Character:FindFirstChild("Right Leg"),
  1059. Character:FindFirstChild("Left Leg")
  1060. }
  1061. if Joints[Limb] == nil then return false end
  1062. if Limbs[Limb] == nil then return false end
  1063. if Limb == 1 then
  1064. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1065. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1066. elseif Limb == 2 then
  1067. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1068. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1069. elseif Limb == 3 then
  1070. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1071. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1072. elseif Limb == 4 then
  1073. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1074. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1075. end
  1076. end
  1077.  
  1078. function EnableLimb(Limb, Character)
  1079. if Character == nil then return false end
  1080. if Character:FindFirstChild("Torso") == nil then return false end
  1081. local Joints = {
  1082. Character.Torso:FindFirstChild("Right Shoulder 2"),
  1083. Character.Torso:FindFirstChild("Left Shoulder 2"),
  1084. Character.Torso:FindFirstChild("Right Hip 2"),
  1085. Character.Torso:FindFirstChild("Left Hip 2")
  1086. }
  1087. local Limbs = {
  1088. Character:FindFirstChild("Right Arm"),
  1089. Character:FindFirstChild("Left Arm"),
  1090. Character:FindFirstChild("Right Leg"),
  1091. Character:FindFirstChild("Left Leg")
  1092. }
  1093. if Joints[Limb] == nil then return false end
  1094. if Limbs[Limb] == nil then return false end
  1095. if Limb == 1 then
  1096. Joints[Limb].Name = "Right Shoulder"
  1097. elseif Limb == 2 then
  1098. Joints[Limb].Name = "Left Shoulder"
  1099. elseif Limb == 3 then
  1100. Joints[Limb].Name = "Right Hip"
  1101. elseif Limb == 4 then
  1102. Joints[Limb].Name = "Left Hip"
  1103. end
  1104. Animate = Character:FindFirstChild("Animate")
  1105. if Animate == nil then return false end
  1106. Animate = Animate:Clone()
  1107. Character.Animate:Remove()
  1108. Animate.Parent = Character
  1109. end
  1110.  
  1111. function playAnimation(format, mouse)
  1112. if format == "equip" then
  1113. EnableLimb(1, Player.Character)
  1114. EnableLimb(2, Player.Character)
  1115. DisableLimb(2, Player.Character)
  1116. SetSpeed(2, 0.1, Player.Character)
  1117. ForceAngle(2, 0, Player.Character)
  1118. SetAngle(2, math.rad(-50), Player.Character)
  1119. wait(0.25)
  1120. if Player.Character:FindFirstChild(Name.. " (Holstered)") == nil then makeParts("RightHolster") end
  1121. Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
  1122. local w = Instance.new("Weld")
  1123. w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
  1124. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  1125. w.C0 = CFrame.new(0.5, -0.25, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1126. w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50), 0, 0)
  1127. w.Parent = Player.Character[Name.. " (Holstered)"].Handle
  1128. SetAngle(2, 0, Player.Character)
  1129. wait(0.25)
  1130. DisableLimb(1, Player.Character)
  1131. ForceAngle(1, 0, Player.Character)
  1132. delay(0.3, function() Player.Character[Name.. " (Holstered)"].Handle.Equip:Play() end)
  1133. for i = 0, 1, 0.05 do
  1134. if Player.Character:FindFirstChild("Torso") ~= nil then
  1135. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1136. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1137. 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)
  1138. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1139. 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)
  1140. 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)
  1141. w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50 - i * 25), 0, -math.rad(i * 15))
  1142. wait()
  1143. else return false end
  1144. else return false end
  1145. end
  1146. return playAnimation("hold")
  1147. end
  1148. if format == "unequip" then
  1149. Player.Character[Name].Handle.Weld:Remove()
  1150. local w = Instance.new("Weld")
  1151. w.Part0 = Player.Character[Name].Handle
  1152. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  1153. w.C0 = CFrame.new(0.5, -0.25, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1154. w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50), 0, 0)
  1155. w.Parent = Player.Character[Name].Handle
  1156. for i = 1, 0, -0.05 do
  1157. if Player.Character:FindFirstChild("Torso") ~= nil then
  1158. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1159. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1160. 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)
  1161. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1162. 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)
  1163. 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)
  1164. w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50 - i * 25), 0, -math.rad(i * 15))
  1165. wait()
  1166. else return false end
  1167. else return false end
  1168. end
  1169. w.C0 = CFrame.new(0.5, -0.25, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1170. w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50), 0, 0)
  1171. ResetLimbCFrame(1, Player.Character)
  1172. ResetLimbCFrame(2, Player.Character)
  1173. EnableLimb(1, Player.Character)
  1174. EnableLimb(2, Player.Character)
  1175. DisableLimb(2, Player.Character)
  1176. SetSpeed(2, 0.1, Player.Character)
  1177. ForceAngle(2, 0, Player.Character)
  1178. SetAngle(2, math.rad(-50), Player.Character)
  1179. wait(0.25)
  1180. SetAngle(2, 0, Player.Character)
  1181. removeParts("RightHand")
  1182. makeParts("RightHolster")
  1183. wait(0.25)
  1184. makeParts("RightHand")
  1185. removeParts("RightHolster")
  1186. return true
  1187. end
  1188. if format == "hold" then
  1189. if Player.Character:FindFirstChild("Torso") ~= nil then
  1190. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1191. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1192. 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))
  1193. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1194. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  1195. else return false end
  1196. else return false end
  1197. end
  1198. if format == "reload" then
  1199. Player.Character[Name].Handle.Equip:Play()
  1200. for i = 0, 10, 5 do
  1201. if Player.Character:FindFirstChild("Torso") ~= nil then
  1202. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  1203. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1204. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 - (i / 25), 0.2, 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 - i), math.rad(-90))
  1205. wait()
  1206. else return false end
  1207. else return false end
  1208. end
  1209. wait(0.1)
  1210. Player.Character[Name].BoltKnobI.Transparency = 1
  1211. Player.Character[Name].BoltShaftI.Transparency = 1
  1212. Player.Character[Name].BoltShaftO.Transparency = 0
  1213. Player.Character[Name].BoltKnobO.Transparency = 0
  1214. for i = 0, 10, 1.5 do
  1215. if Player.Character:FindFirstChild("Torso") ~= nil then
  1216. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  1217. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1218. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.9, 0.2 - (i / 25), 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  1219. wait()
  1220. else return false end
  1221. else return false end
  1222. end
  1223. Player.Character[Name].Handle.Equip:Stop()
  1224. Player.Character[Name].Handle.Reload:Play()
  1225. Player.Character[Name].Magazine.Transparency = 1
  1226. magazineDrop = Player.Character[Name].Magazine:Clone()
  1227. magazineDrop.Transparency = 0
  1228. magazineDrop.CanCollide = true
  1229. magazineDrop.Parent = game.Workspace
  1230. 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)
  1231. delay(0.1, function() magazineDrop.CanCollide = true end)
  1232. for i = 0, 25, 5 do
  1233. if Player.Character:FindFirstChild("Torso") ~= nil then
  1234. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1235. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1236. 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))
  1237. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1238. 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)
  1239. wait()
  1240. else return false end
  1241. else return false end
  1242. end
  1243. magazineNew = Player.Character[Name].Magazine:Clone()
  1244. magazineNew.Name = "New Magazine"
  1245. magazineNew.Transparency = 0
  1246. magazineNew.Parent = Player.Character[Name]
  1247. local w = Instance.new("Weld")
  1248. w.Part0 = magazineNew
  1249. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  1250. w.C0 = CFrame.new(0, 1.1, 0)
  1251. w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1252. w.Parent = magazineNew
  1253. wait(0.2)
  1254. for i = 25, 0, -5 do
  1255. if Player.Character:FindFirstChild("Torso") ~= nil then
  1256. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1257. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1258. 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))
  1259. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1260. 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)
  1261. wait()
  1262. else return false end
  1263. else return false end
  1264. end
  1265. Player.Character[Name].Magazine.Transparency = 0
  1266. Player.Character[Name]["New Magazine"]:Remove()
  1267. wait(0.8)
  1268. Player.Character[Name].Handle.Reload:Stop()
  1269. Player.Character[Name].Handle.Equip:Play()
  1270. for i = 10, 0, -1.5 do
  1271. if Player.Character:FindFirstChild("Torso") ~= nil then
  1272. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  1273. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1274. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.9, 0.2 - (i / 25), 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  1275. wait()
  1276. else return false end
  1277. else return false end
  1278. end
  1279. Player.Character[Name].BoltKnobI.Transparency = 0
  1280. Player.Character[Name].BoltShaftI.Transparency = 0
  1281. Player.Character[Name].BoltShaftO.Transparency = 1
  1282. Player.Character[Name].BoltKnobO.Transparency = 1
  1283. for i = 10, 0, -5 do
  1284. if Player.Character:FindFirstChild("Torso") ~= nil then
  1285. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  1286. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1287. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 - (i / 25), 0.2, 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 - i), math.rad(-90))
  1288. wait()
  1289. else return false end
  1290. else return false end
  1291. end
  1292. for i = 10, 0, -5 do
  1293. if Player.Character:FindFirstChild("Torso") ~= nil then
  1294. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1295. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1296. 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))
  1297. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1298. 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)
  1299. wait()
  1300. else return false end
  1301. else return false end
  1302. end
  1303. Player.Character[Name].Handle.Equip:Stop()
  1304. end
  1305. if format == "fire" then
  1306. if Player.Character[Name]:FindFirstChild("Handle") ~= nil then
  1307. if silenced then
  1308. Player.Character[Name].Handle.Fire:Stop()
  1309. Player.Character[Name].Handle.Fire.Volume = math.random(3, 8) / 10
  1310. Player.Character[Name].Handle.Fire.Pitch = math.random(20, 25) / 10
  1311. Player.Character[Name].Handle.Fire:Play()
  1312. --coroutine.resume(coroutine.create(function() for i = 0.8, 0, -0.075 do Player.Character[Name].Handle.Fire.Volume = i wait() end Player.Character[Name].Handle.Fire.Volume = 0 end))
  1313. CamShake(10, 2000)
  1314. else
  1315. Player.Character[Name].Handle.Fire:Stop()
  1316. Player.Character[Name].Handle.Fire.Volume = math.random(9, 10) / 10
  1317. Player.Character[Name].Handle.Fire.Pitch = 1
  1318. Player.Character[Name].Handle.Fire:Play()
  1319. --Player.Character[Name].Handle.Fire2:Play()
  1320. --coroutine.resume(coroutine.create(function() for i = 0.8, 0, -0.075 do Player.Character[Name].Handle.Fire.Volume = i wait() end Player.Character[Name].Handle.Fire.Volume = 0 end))
  1321. CamShake(10, 2000)
  1322. end
  1323. else return false end
  1324. if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then
  1325. 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))
  1326. else return false end
  1327. for i = 0, 10, 5 do
  1328. if Player.Character:FindFirstChild("Torso") ~= nil then
  1329. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1330. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1331. 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))
  1332. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1333. 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)
  1334. wait()
  1335. else return false end
  1336. else return false end
  1337. end
  1338. --[[for i = 10, 0, -5 do
  1339. if Player.Character:FindFirstChild("Torso") ~= nil then
  1340. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1341. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1342. 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))
  1343. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1344. 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)
  1345. wait()
  1346. else return false end
  1347. else return false end
  1348. end--]]
  1349. wait(0.75) --Bolt Action
  1350. if silenced == true then
  1351. Player.Character[Name].Handle.Equip:Play()
  1352. end
  1353. for i = 0, 10, 5 do
  1354. if Player.Character:FindFirstChild("Torso") ~= nil then
  1355. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  1356. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1357. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 - (i / 25), 0.2, 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 - i), math.rad(-90))
  1358. wait()
  1359. else return false end
  1360. else return false end
  1361. end
  1362. wait(0.1)
  1363. for i = 0, 10, 1.5 do
  1364. if Player.Character:FindFirstChild("Torso") ~= nil then
  1365. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  1366. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1367. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.9, 0.2 - (i / 25), 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  1368. wait()
  1369. else return false end
  1370. else return false end
  1371. end
  1372. Player.Character[Name].BoltKnobI.Transparency = 1
  1373. Player.Character[Name].BoltShaftI.Transparency = 1
  1374. Player.Character[Name].BoltShaftO.Transparency = 0
  1375. Player.Character[Name].BoltKnobO.Transparency = 0
  1376. makeShell(Player.Character[Name]:FindFirstChild("ShellOut"))
  1377. for i = 10, 0, -1.5 do
  1378. if Player.Character:FindFirstChild("Torso") ~= nil then
  1379. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  1380. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1381. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.9, 0.2 - (i / 25), 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  1382. wait()
  1383. else return false end
  1384. else return false end
  1385. end
  1386. Player.Character[Name].BoltKnobI.Transparency = 0
  1387. Player.Character[Name].BoltShaftI.Transparency = 0
  1388. Player.Character[Name].BoltShaftO.Transparency = 1
  1389. Player.Character[Name].BoltKnobO.Transparency = 1
  1390. for i = 10, 0, -5 do
  1391. if Player.Character:FindFirstChild("Torso") ~= nil then
  1392. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  1393. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1394. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 - (i / 25), 0.2, 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 - i), math.rad(-90))
  1395. wait()
  1396. else return false end
  1397. else return false end
  1398. end
  1399. for i = 10, 0, -5 do
  1400. if Player.Character:FindFirstChild("Torso") ~= nil then
  1401. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1402. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1403. 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))
  1404. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1405. 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)
  1406. wait()
  1407. else return false end
  1408. else return false end
  1409. end
  1410. end
  1411. return true
  1412. end
  1413.  
  1414. function CamShake(time, freq)
  1415. coroutine.resume(coroutine.create(function()
  1416. local cam = game:GetService("Workspace").CurrentCamera
  1417. local time = 10
  1418. local seed = Vector3.new(math.random(100, 200) / freq, math.random(100, 200) / freq, 0)
  1419. if math.random(1, 2) == 1 then seed = Vector3.new(-seed.x, seed.y, 0) end
  1420. if math.random(1, 2) == 1 then seed = Vector3.new(seed.x, -seed.y, 0) end
  1421. 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)
  1422. for i = 1, time do
  1423. 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)
  1424. wait()
  1425. end
  1426. end))
  1427. end
  1428.  
  1429. function makeShell(part)
  1430. if part == nil then return false end
  1431. local casing = Instance.new("Part")
  1432. casing.Name = "Shell"
  1433. casing.formFactor = "Symmetric"
  1434. casing.Size = Vector3.new(1, 1, 1)
  1435. 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)))
  1436. casing.BrickColor = BrickColor.new("New Yeller")
  1437. local mesh = Instance.new("CylinderMesh")
  1438. mesh.Scale = Vector3.new(0.2, 0.6, 0.2)
  1439. mesh.Parent = casing
  1440. casing.Parent = game:GetService("Workspace")
  1441. casing:BreakJoints()
  1442. casing.Velocity = (part.CFrame.lookVector * 65) + Vector3.new(0, 10, 0)
  1443. coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do casing.Transparency = i wait() end casing:Remove() end))
  1444. end
  1445.  
  1446. function Weld(x, y)
  1447. local weld = Instance.new("Weld")
  1448. weld.Part0 = x
  1449. weld.Part1 = y
  1450. CJ = CFrame.new(x.Position)
  1451. C0 = x.CFrame:inverse() * CJ
  1452. C1 = y.CFrame:inverse() * CJ
  1453. weld.C0 = C0
  1454. weld.C1 = C1
  1455. weld.Parent = x
  1456. end
  1457.  
  1458. function tagHumanoid(humanoid)
  1459. local tag = Instance.new("ObjectValue")
  1460. tag.Name = "creator"
  1461. tag.Value = Player
  1462. tag.Parent = humanoid
  1463. local tag = Instance.new("StringValue")
  1464. tag.Name = "creatorType1"
  1465. tag.Value = Name
  1466. tag.Parent = humanoid
  1467. local tag = Instance.new("StringValue")
  1468. tag.Name = "creatorType2"
  1469. tag.Value = "shot"
  1470. tag.Parent = humanoid
  1471. end
  1472.  
  1473. function untagHumanoid(humanoid)
  1474. if humanoid ~= nil then
  1475. local tag = humanoid:FindFirstChild("creator")
  1476. if tag ~= nil then
  1477. tag:Remove()
  1478. end
  1479. local tag = humanoid:FindFirstChild("creatorType1")
  1480. if tag ~= nil then
  1481. tag:Remove()
  1482. end
  1483. local tag = humanoid:FindFirstChild("creatorType2")
  1484. if tag ~= nil then
  1485. tag:Remove()
  1486. end
  1487. end
  1488. end
  1489.  
  1490. function fire(startPoint, endPoint, hit)
  1491. local trail = Instance.new("Part")
  1492. trail.Name = "Bullet Trail"
  1493. trail.BrickColor = BrickColor.new("Bright yellow")
  1494. trail.TopSurface = 0
  1495. trail.BottomSurface = 0
  1496. trail.formFactor = 0
  1497. trail.Size = Vector3.new(1, 1, 1)
  1498. trail.Transparency = 0.6
  1499. trail.Anchored = true
  1500. trail.CanCollide = false
  1501. trail.CFrame = CFrame.new((startPoint + endPoint) / 2, endPoint)
  1502. trail.Parent = game:GetService("Workspace")
  1503. local mesh = Instance.new("SpecialMesh")
  1504. mesh.MeshType = "Brick"
  1505. mesh.Scale = Vector3.new(0.2, 0.2, (startPoint - endPoint).magnitude)
  1506. mesh.Parent = trail
  1507. 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)
  1508. if hit ~= nil then
  1509. if hit.Parent == nil then return end
  1510. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  1511. tagHumanoid(hit.Parent.Humanoid)
  1512. if hit.Name == "Head" then
  1513. hit.Parent.Humanoid:TakeDamage(damage * 10)
  1514. elseif hit.Name == "Torso" then
  1515. hit.Parent.Humanoid:TakeDamage(damage * 2)
  1516. else
  1517. hit.Parent.Humanoid:TakeDamage(damage)
  1518. end
  1519. if HP == true then
  1520. hit.Parent.Humanoid.Sit = true
  1521. end
  1522. delay(0.1, function() untagHumanoid(hit.Parent.Humanoid) end)
  1523. end
  1524. if hit.Anchored == false then
  1525. hit.Velocity = hit.Velocity + ((endPoint - startPoint).unit * (damage * 2))
  1526. end
  1527. end
  1528. end
  1529.  
  1530. function onButton1Down(mouse)
  1531. if selected == false then return end
  1532. 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
  1533. if Player.Character[Name]:FindFirstChild("Handle") == nil then return end
  1534. if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
  1535. if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end end
  1536. if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end end
  1537. mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
  1538. Button1Down = true
  1539. canFire = false
  1540. canFire2 = true
  1541. while canFire2 == true do
  1542. local humanoid = Player.Character:FindFirstChild("Humanoid")
  1543. if humanoid == nil then
  1544. canFire2 = false
  1545. break
  1546. end
  1547. if humanoid.Health <= 0 then
  1548. canFire2 = false
  1549. break
  1550. end
  1551. local fireLeft = false
  1552. if automatic == false and burst == false then
  1553. canFire2 = false
  1554. elseif automatic == false and burst == true then
  1555. if burstCount >= burstCountMax then
  1556. canFire2 = false
  1557. burstCount = 0
  1558. break
  1559. end
  1560. burstCount = burstCount + 1
  1561. elseif automatic == true and burst == false then
  1562. fireLeft = true
  1563. end
  1564. if magazine.Value > 0 then
  1565. magazine.Value = magazine.Value - 1
  1566. updateGui()
  1567. fire(Player.Character[Name].Muzzle.Position, mouse.Hit.p, mouse.Target)
  1568. coroutine.resume(coroutine.create(function()
  1569. if dual == true then
  1570. playAnimation("rightFire")
  1571. elseif dual == false then
  1572. playAnimation("fire")
  1573. end
  1574. end))
  1575. else
  1576. Player.Character[Name].Handle.Empty:Play()
  1577. end
  1578. if fireLeft == true and dual == true and automatic == true then
  1579. if magazine.Value > 0 then
  1580. coroutine.resume(coroutine.create(function()
  1581. wait(readyTime / 2)
  1582. magazine.Value = magazine.Value - 1
  1583. updateGui()
  1584. fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
  1585. playAnimation("leftFire")
  1586. end))
  1587. else
  1588. coroutine.resume(coroutine.create(function()
  1589. wait(readyTime / 2)
  1590. Player.Character[Name].Handle.Empty:Play()
  1591. end))
  1592. end
  1593. end
  1594. wait(readyTime)
  1595. end
  1596. mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
  1597. canFire = true
  1598. end
  1599. end
  1600.  
  1601. function onButton1Up(mouse)
  1602. if selected == false then return end
  1603. Button1Down = false
  1604. canFire2 = false
  1605. burstCount = 0
  1606. while canFire == false do wait() end
  1607. if dual == true and automatic == false then
  1608. if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end
  1609. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
  1610. mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
  1611. canFire = false
  1612. canFire2 = true
  1613. while canFire2 == true do
  1614. local humanoid = Player.Character:FindFirstChild("Humanoid")
  1615. if humanoid == nil then
  1616. canFire2 = false
  1617. break
  1618. end
  1619. if humanoid.Health <= 0 then
  1620. canFire2 = false
  1621. break
  1622. end
  1623. if burst == false then
  1624. canFire2 = false
  1625. elseif burst == true then
  1626. if burstCount >= burstCountMax then
  1627. canFire2 = false
  1628. burstCount = 0
  1629. break
  1630. end
  1631. burstCount = burstCount + 1
  1632. end
  1633. if magazine.Value <= 0 then
  1634. Player.Character[Name].Handle.Empty:Play()
  1635. else
  1636. coroutine.resume(coroutine.create(function()
  1637. playAnimation("leftFire")
  1638. end))
  1639. magazine.Value = magazine.Value - 1
  1640. updateGui()
  1641. fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
  1642. end
  1643. wait(readyTime)
  1644. end
  1645. mouse.Icon = "http://www.roblox.com/asset/?id=49912389"
  1646. canFire = true
  1647. end
  1648. end
  1649.  
  1650. function onKeyDown(key, mouse)
  1651. if selected == false then return end
  1652. key = key:lower()
  1653. if key == "q" and Button1Down == false and canFire == true then
  1654. if mouse.Target == nil then return end
  1655. if game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent) ~= nil then
  1656. if dual == true then onKeyDown("t", mouse) end
  1657. onDeselected(mouse)
  1658. removeParts("RightHolster")
  1659. script.Parent.Parent = game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent).Backpack
  1660. end
  1661. end
  1662. if key == "e" and Button1Down == false and canFire == true and canSilence == true then
  1663. if silenced then
  1664. silenced = false
  1665. if Player.Character:FindFirstChild(Name) == nil then return end
  1666. if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
  1667. if Player.Character[Name]:FindFirstChild("Muzzle 2") == nil then return end
  1668. Player.Character[Name].Muzzle.Transparency = 1
  1669. Player.Character[Name].Muzzle.Name = "Silencer"
  1670. Player.Character[Name]["Muzzle 2"].Name = "Muzzle"
  1671. if dual == true then
  1672. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
  1673. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle 2") == nil then return end
  1674. Player.Character[Name.. " (Left)"].Muzzle.Transparency = 1
  1675. Player.Character[Name.. " (Left)"].Muzzle.Name = "Silencer"
  1676. Player.Character[Name.. " (Left)"]["Muzzle 2"].Name = "Muzzle"
  1677. end
  1678. else
  1679. silenced = true
  1680. if Player.Character:FindFirstChild(Name) == nil then return end
  1681. if Player.Character[Name]:FindFirstChild("Silencer") == nil then return end
  1682. if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
  1683. Player.Character[Name].Silencer.Transparency = 0
  1684. Player.Character[Name].Muzzle.Name = "Muzzle 2"
  1685. Player.Character[Name].Silencer.Name = "Muzzle"
  1686. if dual == true then
  1687. if Player.Character[Name.. " (Left)"]:FindFirstChild("Silencer") == nil then return end
  1688. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
  1689. Player.Character[Name.. " (Left)"].Silencer.Transparency = 0
  1690. Player.Character[Name.. " (Left)"].Muzzle.Name = "Muzzle 2"
  1691. Player.Character[Name.. " (Left)"].Silencer.Name = "Muzzle"
  1692. end
  1693. end
  1694. end
  1695. if key == "r" and Button1Down == false and canFire == true then
  1696. if ammo.Value > 0 and magazine.Value ~= magazineMax.Value then
  1697. canFire = false
  1698. burstCount = 0
  1699. mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
  1700. if magazine.Value > 0 then ammo.Value = ammo.Value + magazine.Value magazine.Value = 0 end
  1701. updateGui()
  1702. if dual == true then
  1703. playAnimation("reloadDual")
  1704. elseif dual == false then
  1705. playAnimation("reload")
  1706. end
  1707. if ammo.Value - magazineMax.Value < 0 then
  1708. magazine.Value = ammo.Value
  1709. ammo.Value = 0
  1710. elseif ammo.Value - magazineMax.Value >= 0 then
  1711. ammo.Value = ammo.Value - magazineMax.Value
  1712. magazine.Value = magazineMax.Value
  1713. end
  1714. updateGui()
  1715. mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
  1716. canFire = true
  1717. end
  1718. end
  1719. if key == "t" and Button1Down == false and canFire == true and canDual == true then
  1720. canFire = false
  1721. if dual == false then
  1722. local weapon = nil
  1723. for _, p in pairs(Player.Backpack:GetChildren()) do
  1724. if p.Name == Name and p ~= script.Parent then weapon = p break end
  1725. end
  1726. if weapon ~= nil then
  1727. dual = true
  1728. weapon.Name = "Dual"
  1729. weapon.Parent = script
  1730. silenced = false
  1731. removeParts("RightHand")
  1732. makeParts("RightHand")
  1733. removeParts("RightHolster")
  1734. makeParts("LeftHolster")
  1735. playAnimation("leftEquip")
  1736. removeParts("LeftHolster")
  1737. makeParts("LeftHand")
  1738. magazineMax.Value = math.ceil(magazineMax.Value * 2)
  1739. ammoMax.Value = math.ceil(ammoMax.Value * 2)
  1740. magazine.Value = magazine.Value + weapon.Magazine.Value
  1741. ammo.Value = ammo.Value + weapon.Ammo.Value
  1742. updateGui()
  1743. end
  1744. elseif dual == true then
  1745. local weapon = script:FindFirstChild("Dual")
  1746. if weapon ~= nil then
  1747. dual = false
  1748. weapon.Name = Name
  1749. weapon.Parent = Player.Backpack
  1750. silenced = false
  1751. removeParts("RightHand")
  1752. makeParts("RightHand")
  1753. playAnimation("leftUnequip")
  1754. removeParts("LeftHand")
  1755. makeParts("RightHolster")
  1756. playAnimation("hold")
  1757. weapon.Magazine.Value = math.floor(magazine.Value / 2)
  1758. weapon.Ammo.Value = math.floor(ammo.Value / 2)
  1759. magazineMax.Value = math.ceil(magazineMax.Value / 2)
  1760. ammoMax.Value = math.ceil(ammoMax.Value / 2)
  1761. magazine.Value = math.ceil(magazine.Value / 2)
  1762. ammo.Value = math.ceil(ammo.Value / 2)
  1763. updateGui()
  1764. end
  1765. end
  1766. canFire = true
  1767. end
  1768. if key == "y" and canZoom == true then
  1769. if zoom == false then
  1770. zoom = true
  1771. local pos = mouse.Hit.p
  1772. local target = mouse.Target
  1773. local cam = game:GetService("Workspace").CurrentCamera
  1774. focus = Instance.new("Part", workspace)
  1775. focus.Anchored = true
  1776. focus.CanCollide = false
  1777. focus.Transparency = 1
  1778. focus.TopSurface = 0
  1779. focus.BottomSurface = 0
  1780. focus.formFactor = "Plate"
  1781. focus.Size = Vector3.new(0, 0, 0)
  1782. focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
  1783. cam.CameraSubject = focus
  1784. cam.CameraType = "Attach"
  1785. while zoom == true and selected == true do
  1786. local set = false
  1787. if target ~= nil then
  1788. if target.Parent ~= nil then
  1789. if target.Anchored == false then
  1790. 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)
  1791. set = true
  1792. end
  1793. end
  1794. end
  1795. if set == false then
  1796. focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
  1797. end
  1798. wait()
  1799. end
  1800. if focus ~= nil then focus:Remove() focus = nil end
  1801. local cam = game:GetService("Workspace").CurrentCamera
  1802. cam.CameraSubject = Player.Character:FindFirstChild("Humanoid")
  1803. cam.CameraType = "Custom"
  1804. else
  1805. zoom = false
  1806. end
  1807. end
  1808. if key == "u" and Button1Down == false and canFire == true then
  1809. if automatic == false and burst == false then
  1810. if switchToBurst == true then
  1811. burst = true
  1812. local m = Instance.new("Message", Player)
  1813. m.Text = "Burst"
  1814. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  1815. delay(2.5, function() m:Remove() end)
  1816. elseif switchToAutomatic == true then
  1817. automatic = true
  1818. local m = Instance.new("Message", Player)
  1819. m.Text = "Automatic"
  1820. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  1821. delay(2.5, function() m:Remove() end)
  1822. end
  1823. elseif automatic == false and burst == true then
  1824. if switchToAutomatic == true then
  1825. automatic = true
  1826. burst = false
  1827. local m = Instance.new("Message", Player)
  1828. m.Text = "Automatic"
  1829. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  1830. delay(2.5, function() m:Remove() end)
  1831. elseif switchToSingle == true then
  1832. burst = false
  1833. local m = Instance.new("Message", Player)
  1834. m.Text = "Single"
  1835. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  1836. delay(2.5, function() m:Remove() end)
  1837. end
  1838. elseif automatic == true and burst == false then
  1839. if switchToSingle == true then
  1840. automatic = false
  1841. local m = Instance.new("Message", Player)
  1842. m.Text = "Single"
  1843. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  1844. delay(2.5, function() m:Remove() end)
  1845. elseif switchToBurst == true then
  1846. automatic = false
  1847. burst = true
  1848. local m = Instance.new("Message", Player)
  1849. m.Text = "Burst"
  1850. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  1851. delay(2.5, function() m:Remove() end)
  1852. end
  1853. end
  1854. end
  1855. end
  1856.  
  1857. function onSelected(mouse)
  1858. if selected == true then return end
  1859. selected = true
  1860. canFire = false
  1861. mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
  1862. while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
  1863. if Player.Character.WeaponActivated.Value == nil then break end
  1864. if Player.Character.WeaponActivated.Value.Parent == nil then break end
  1865. wait()
  1866. end
  1867. updateGui()
  1868. local weapon = Instance.new("ObjectValue")
  1869. weapon.Name = "WeaponActivated"
  1870. weapon.Value = script.Parent
  1871. weapon.Parent = Player.Character
  1872. DisableLimb(1, Player.Character)
  1873. DisableLimb(2, Player.Character)
  1874. ForceAngle(1, 0, Player.Character)
  1875. ForceAngle(2, 0, Player.Character)
  1876. if dual == true then
  1877. coroutine.resume(coroutine.create(function() playAnimation("leftEquip") end))
  1878. playAnimation("rightEquip")
  1879. removeParts("LeftHolster")
  1880. makeParts("LeftHand")
  1881. else
  1882. playAnimation("equip")
  1883. end
  1884. removeParts("RightHolster")
  1885. makeParts("RightHand")
  1886. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  1887. mouse.Button1Up:connect(function() onButton1Up(mouse) end)
  1888. mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
  1889. mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
  1890. canFire = true
  1891. end
  1892.  
  1893. function onDeselected(mouse)
  1894. if selected == false then return end
  1895. Button1Down = false
  1896. while canFire == false do
  1897. wait()
  1898. end
  1899. selected = false
  1900. if dual == true then
  1901. if math.random(1, 2) == 1 then
  1902. coroutine.resume(coroutine.create(function() playAnimation("leftUnequip") end))
  1903. wait(math.random(1, 10) / 10)
  1904. playAnimation("rightUnequip")
  1905. else
  1906. coroutine.resume(coroutine.create(function() playAnimation("rightUnequip") end))
  1907. wait(math.random(1, 10) / 10)
  1908. playAnimation("leftUnequip")
  1909. end
  1910. removeParts("LeftHand")
  1911. makeParts("LeftHolster")
  1912. else
  1913. playAnimation("unequip")
  1914. end
  1915. removeParts("RightHand")
  1916. makeParts("RightHolster")
  1917. ForceAngle(1, 0, Player.Character)
  1918. ForceAngle(2, 0, Player.Character)
  1919. ResetLimbCFrame(1, Player.Character)
  1920. ResetLimbCFrame(2, Player.Character)
  1921. EnableLimb(1, Player.Character)
  1922. EnableLimb(2, Player.Character)
  1923. silenced = false
  1924. if Player.PlayerGui:FindFirstChild(Name) ~= nil then Player.PlayerGui[Name]:Remove() end
  1925. if Player.Character:FindFirstChild("WeaponActivated") ~= nil then
  1926. if Player.Character.WeaponActivated.Value == script.Parent then
  1927. Player.Character.WeaponActivated:Remove()
  1928. end
  1929. end
  1930. while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
  1931. if Player.Character.WeaponActivated.Value == nil then break end
  1932. if Player.Character.WeaponActivated.Value.Parent == nil then break end
  1933. wait()
  1934. end
  1935. end
  1936.  
  1937. if script.Parent.className ~= "HopperBin" then
  1938. if Player == nil then print("Error: Player not found!") return end
  1939. Tool = Instance.new("HopperBin")
  1940. Tool.Name = Name
  1941. Tool.Parent = Player.Backpack
  1942. script.Name = "Main"
  1943. script.Parent = Tool
  1944. end wait() if script.Parent.className == "HopperBin" then
  1945. while script.Parent.Parent.className ~= "Backpack" do
  1946. wait()
  1947. end
  1948. if script.Parent:FindFirstChild("MagazineMax") == nil then
  1949. magazineMax = Instance.new("NumberValue")
  1950. magazineMax.Name = "MagazineMax"
  1951. magazineMax.Value = 5
  1952. magazineMax.Parent = script.Parent
  1953. else
  1954. magazineMax = script.Parent.MagazineMax
  1955. end
  1956. if script.Parent:FindFirstChild("Magazine") == nil then
  1957. magazine = Instance.new("NumberValue")
  1958. magazine.Name = "Magazine"
  1959. magazine.Value = 0
  1960. magazine.Parent = script.Parent
  1961. else
  1962. magazine = script.Parent.Magazine
  1963. end
  1964. if script.Parent:FindFirstChild("AmmoMax") == nil then
  1965. ammoMax = Instance.new("NumberValue")
  1966. ammoMax.Name = "AmmoMax"
  1967. ammoMax.Value = 300
  1968. ammoMax.Parent = script.Parent
  1969. else
  1970. ammoMax = script.Parent.AmmoMax
  1971. end
  1972. if script.Parent:FindFirstChild("Ammo") == nil then
  1973. ammo = Instance.new("NumberValue")
  1974. ammo.Name = "Ammo"
  1975. ammo.Value = script.Parent.AmmoMax.Value
  1976. ammo.Parent = script.Parent
  1977. else
  1978. ammo = script.Parent.Ammo
  1979. end
  1980. Player = script.Parent.Parent.Parent
  1981. makeParts("RightHolster")
  1982. script.Parent.Selected:connect(onSelected)
  1983. script.Parent.Deselected:connect(onDeselected)
  1984. end
  1985.  
  1986. --mediafire
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement