Advertisement
Nova2152

Taco and Potatos

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