Advertisement
Void_scripter0

P90

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