jAkEtheEpiCSaUcE

Untitled

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