Advertisement
SmokeDelsin

good script

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