Advertisement
Noobpwner174

Untitled

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