Advertisement
KaiXGT

Armed Sniper

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