Advertisement
RazorShockk

Roblox M110 Script

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