thetacolord609

Untitled

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