Advertisement
ThatOneScript

Shotgun

Jun 4th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.09 KB | None | 0 0
  1. -Shotgun Gifted by TheRedAngel, Local Script!
  2.  
  3. Players = game:GetService("Players")
  4. Me = Players.LocalPlayer
  5. Char = Me.Character
  6. necko = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  7. Asset = "http://www.roblox.com/asset/?id="
  8. EffectModel = nil
  9. MeleeDmg = 55
  10. Accuracy = {Minimum = 2, Maximum = 5.5, Momentum = 2}
  11. Selected = false
  12. ReloadFlash = false
  13. Attacking = false
  14. ReloadHold = false
  15. Reloading = false
  16. Swinging = false
  17. Aiming = false
  18. ReloadOn = false
  19. Debounce = true
  20. Hurt = false
  21. ModelName = "Weapon"
  22. ToolName = "Weapon"
  23. Icon = Asset..(58334502)
  24. function ReNew()
  25. if EffectModel then
  26. if EffectModel.Parent ~= workspace then
  27. pcall(function() EffectModel:remove() end)
  28. EffectModel = Instance.new("Model",workspace)
  29. EffectModel.Name = "Effects"
  30. end
  31. else
  32. EffectModel = Instance.new("Model",workspace)
  33. EffectModel.Name = "Effects"
  34. end
  35. end
  36. Ammunition = {
  37. MaxAmmo = 8,
  38. Ammo = 0,
  39. Ammoleft = 40,
  40. }
  41. Images = {
  42. Asset..(64291927),
  43. Asset..(64291941),
  44. Asset..(64291961),
  45. Asset..(64291977),
  46. }
  47. Sounds = {
  48. Fire = {Id = Asset..(2697294), Pitch = 0.92, Volume = 0.8},
  49. Reload = {Id = Asset..(2697295), Pitch = 1, Volume = 0.5},
  50. Slash = {Id = "rbxasset://sounds//swordslash.wav", Pitch = 1.2, Volume = 0.6},
  51. Out = {Id = "rbxasset://sounds\\clickfast.wav", Pitch = 1.4, Volume = 0.6},
  52. Hit = {Id = Asset..(10209590), Pitch = 1.1, Volume = 0.45},
  53. PartHit = {Id = "rbxasset://sounds\\metal.ogg", Pitch = 1, Volume = 0.2},
  54. }
  55. ContentProvider = game:GetService("ContentProvider")
  56. for _,v in pairs(Images) do ContentProvider:Preload(v) end
  57. V3 = Vector3.new
  58. C3 = Color3.new
  59. BN = BrickColor.new
  60. CN = CFrame.new
  61. CA = CFrame.Angles
  62. MR = math.rad
  63. MRA = math.random
  64. MP = math.pi
  65. MH = math.huge
  66. UD = UDim2.new
  67. function RC(Pos, Dir, Max, Ignore)
  68. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999)), Ignore)
  69. end
  70. function RayC(Start, En, MaxDist, Ignore)
  71. return RC(Start, (En - Start), MaxDist, Ignore)
  72. end
  73. function ComputePos(pos1, pos2)
  74. return CN(pos1, V3(pos2.x, pos1.y, pos2.z))
  75. end
  76. function DetectSurface(pos, part)
  77. local surface = nil
  78. local pospos = part.CFrame
  79. local pos2 = pospos:pointToObjectSpace(pos)
  80. local siz = part.Size
  81. local shaep = part.Shape
  82. if shaep == Enum.PartType.Ball or shaep == Enum.PartType.Cylinder then
  83. surface = {"Anything", CN(pospos.p, pos)*CN(0, 0, -(pospos.p - pos).magnitude+0.12)*CA(MR(-90), 0, 0)}
  84. else
  85. if pos2.Y > ((siz.Y/2)-0.01) then
  86. surface = {"Top", CA(0, 0, 0)}
  87. elseif pos2.Y < -((siz.Y/2)-0.01) then
  88. surface = {"Bottom", CA(-MP, 0, 0)}
  89. elseif pos2.X > ((siz.X/2)-0.01) then
  90. surface = {"Right", CA(0, 0, MR(-90))}
  91. elseif pos2.X < -((siz.X/2)-0.01) then
  92. surface = {"Left", CA(0, 0, MR(90))}
  93. elseif pos2.Z > ((siz.Z/2)-0.01) then
  94. surface = {"Back", CA(MR(90), 0, 0)}
  95. elseif pos2.Z < -((siz.Z/2)-0.01) then
  96. surface = {"Front", CA(MR(-90), 0, 0)}
  97. end
  98. end
  99. return surface
  100. end
  101. function Compute(pos1, pos2)
  102. local pos3 = Vector3.new(pos2.x, pos1.y, pos2.z)
  103. return CN(pos1, pos3)
  104. end
  105. function waitChild(n, p)
  106. local c = p:findFirstChild(n)
  107. if c then return c end
  108. while true do
  109. c = p.ChildAdded:wait()
  110. if c.Name == n then return c end
  111. end
  112. end
  113. function Notime(func)
  114. coroutine.resume(coroutine.create(function()
  115. func()
  116. end))
  117. end
  118. local C3 = Color3.new
  119. local UD = UDim2.new
  120. local V2 = Vector2.new
  121. Torso = waitChild("Torso", Char)
  122. Head = waitChild("Head", Char)
  123. Rarm = waitChild("Right Arm", Char)
  124. Larm = waitChild("Left Arm", Char)
  125. Rleg = waitChild("Right Leg", Char)
  126. Lleg = waitChild("Left Leg", Char)
  127. Neck = waitChild("Neck", Torso)
  128. Hum = waitChild("Humanoid", Char)
  129. RSH = waitChild("Right Shoulder", Torso)
  130. LSH = waitChild("Left Shoulder", Torso)
  131. RH = waitChild("Right Hip", Torso)
  132. LH = waitChild("Left Hip", Torso)
  133. RSH.Part0 = Torso
  134. LSH.Part0 = Torso
  135. RH.Part0 = Torso
  136. LH.Part0 = Torso
  137. local Classes = {"Frame", "ImageLabel", "ImageButton", "TextLabel", "TextButton", "TextBox"}
  138. function Make(Class, Par, Size, Pos, Color, Trans, Border, Borderc, Txt, TxtC, Img)
  139. local Mk = "Frame"
  140. for _,v in pairs(Classes) do
  141. if Class == v then
  142. Mk = v
  143. end
  144. end
  145. local g = Instance.new(Mk)
  146. g.Size = Size
  147. g.Position = Pos
  148. g.BackgroundColor3 = Color
  149. g.Transparency = Trans
  150. g.BorderSizePixel = Border
  151. g.BorderColor3 = Borderc
  152. if Mk == "TextButton" or Mk == "TextLabel" or Mk == "TextBox" then
  153. g.Text = Txt
  154. g.TextColor3 = TxtC
  155. elseif Mk == "ImageLabel" or Mk == "ImageButton" then
  156. g.Image = Img
  157. end
  158. g.Parent = Par
  159. return g
  160. end
  161. Gui = Me:findFirstChild("PlayerGui")
  162. if Gui then
  163. for _,v in pairs(Gui:children()) do if v.Name == "Weapon GUI" then v:remove() end end
  164. end
  165. Screen = Instance.new("ScreenGui")
  166. Screen.Name = "Weapon GUI"
  167. AmmoTable = {}
  168. AccuracyGuis = {}
  169. lul = {
  170. {unit = V2(0, -1), size = V2(2, 25), offset = V2(-1, -1-25)},
  171. {unit = V2(1, 0), size = V2(25, 2), offset = V2(1, -1)},
  172. {unit = V2(0, 1), size = V2(2, 25), offset = V2(-1, -1)},
  173. {unit = V2(-1, 0), size = V2(25, 2), offset = V2(-1-25, -1)}
  174. }
  175. Main = Make("Frame", Screen, UD(0, 175, 0, 20), UD(1, -185-60, 1, -30), C3(0.25, 0.25, 0.3), 0.6, 0, C3())
  176. for i = 1, Ammunition.MaxAmmo, 1 do
  177. local Fr = Make("Frame", Main, UD(0, 8, 0, 14), UD(1, -12*i, 0, -14-6), C3(0.25, 0.25, 0.3), 0.6, 0, C3())
  178. table.insert(AmmoTable, Fr)
  179. end
  180. AmmoAtm = Make("TextLabel", Main, UD(0, 0, 0, 0), UD(0, 8, 0.5, 0), C3(), 0, 0, C3(), "0", C3(1, 1, 1))
  181. AmmoAtm.BackgroundTransparency = 1
  182. AmmoAtm.TextXAlignment = "Left"
  183. AmmoAtm.Font = "ArialBold"
  184. AmmoAtm.FontSize = "Size18"
  185. AmmoLeft = Make("TextLabel", Main, UD(0, 0, 0, 0), UD(1, -8, 0.5, 0), C3(), 0, 0, C3(), "40", C3(1, 1, 1))
  186. AmmoLeft.BackgroundTransparency = 1
  187. AmmoLeft.TextXAlignment = "Right"
  188. AmmoLeft.Font = "ArialBold"
  189. AmmoLeft.FontSize = "Size18"
  190. ReloadGui = Make("TextLabel", Main, UD(0, 0, 0, 0), UD(1, -12, 0, -40), C3(), 1, 0, C3(), "RELOAD", C3(1, 0.25, 0.1))
  191. ReloadGui.TextXAlignment = "Right"
  192. ReloadGui.Font = "ArialBold"
  193. ReloadGui.FontSize = "Size24"
  194. for _, prop in pairs(lul) do
  195. local g = Make("Frame", Screen, UD(0, prop.size.x, 0, prop.size.y), UD(0.5, prop.offset.x, 0.5, prop.offset.y), C3(0.8, 0.8, 0.9), 1, 0, C3())
  196. table.insert(AccuracyGuis, {Gui = g, props = prop})
  197. end
  198. Screen.Parent = Gui
  199. local Offset = 0.1
  200. local Thing = 1
  201. local Speed1 = 0.1
  202. local Speed2 = 0
  203. local TempAcc = 0
  204. local AccTimesMax = 17
  205. local AccTime = 1.25
  206. local AccTimes = AccTimesMax
  207. local AccOn = false
  208. function AddInaccuracy(Acc)
  209. TempAcc = Acc
  210. end
  211. Notime(function()
  212. while true do
  213. ReNew()
  214. AmmoAtm.Text = Ammunition.Ammo
  215. AmmoLeft.Text = Ammunition.Ammoleft
  216. for i,v in pairs(AmmoTable) do
  217. v.Transparency = 1
  218. end
  219. for i = 1, Ammunition.Ammo do
  220. AmmoTable.Transparency = 0.6
  221. end
  222. if Ammunition.Ammo <= Ammunition.MaxAmmo/4 then ReloadFlash = true else ReloadFlash = false end
  223. local Speed = Torso.Velocity.magnitude
  224. Offset = 0
  225. if Speed > 1 then
  226. Speed1 = Speed
  227. Thing = Thing*1.2
  228. else
  229. Speed2 = Speed
  230. local lol = 1.4
  231. if AccOn then lol = AccTime end
  232. Thing = Thing/lol
  233. end
  234. if TempAcc ~= 0 then
  235. Speed1 = TempAcc
  236. Thing = TempAcc/2
  237. AccOn = true
  238. if TempAcc ~= 0 then
  239. AccTimes = AccTimes - 1
  240. if AccTimes < 1 then AccTimes = AccTimesMax Notime(function() wait(0.4) AccOn = false end) TempAcc = 0 end
  241. end
  242. end
  243. if Thing < 1 then Thing = 1 elseif Thing > 14 then Thing = 14 end
  244. Offset = Accuracy.Minimum + ((Speed1 - Speed1/Thing)/(Speed1 - Speed1/14))*Accuracy.Maximum
  245. Accuracy.Momentum = Offset
  246. wait()
  247. end
  248. end)
  249. Notime(function()
  250. while true do
  251. if ReloadFlash then
  252. if ReloadOn then
  253. ReloadOn = false
  254. ReloadGui.Transparency = 1
  255. else
  256. ReloadOn = true
  257. ReloadGui.Transparency = 0
  258. end
  259. else
  260. ReloadGui.Transparency = 1
  261. end
  262. wait(0.4)
  263. end
  264. end)
  265. Add = {
  266. Head = function(P, Scale)
  267. local m = Instance.new("SpecialMesh")
  268. m.MeshType = "Head"
  269. m.Scale = Scale or V3(1, 1, 1)
  270. m.Parent = P
  271. return m
  272. end,
  273. Sphere = function(P, Scale)
  274. local m = Instance.new("SpecialMesh")
  275. m.MeshType = "Sphere"
  276. m.Scale = Scale or V3(1, 1, 1)
  277. m.Parent = P
  278. return m
  279. end,
  280. Wedge = function(P, Scale)
  281. local m = Instance.new("SpecialMesh")
  282. m.MeshType = "Wedge"
  283. m.Scale = Scale or V3(1, 1, 1)
  284. m.Parent = P
  285. return m
  286. end,
  287. Block = function(P, Scale, Bevel)
  288. local m = Instance.new("BlockMesh")
  289. m.Bevel = Bevel
  290. m.Scale = Scale or V3(1,1,1)
  291. m.Parent = P
  292. return m
  293. end
  294. }
  295. for _,v in pairs(Sounds) do
  296. ContentProvider:Preload(v.Id)
  297. end
  298. function PlaySound(Sound, bool)
  299. Pitch = Sound.Pitch
  300. if bool then
  301. Pitch = MRA((Sound.Pitch*0.75)*1000, (Sound.Pitch*1.15)*1000)/1000
  302. end
  303. local a = Instance.new("Sound")
  304. a.SoundId = Sound.Id
  305. a.Volume = Sound.Volume
  306. a.Pitch = Pitch
  307. a.Name = "FX"
  308. a.Parent = Torso
  309. a:play()
  310. Notime(function()
  311. wait(1)
  312. a:remove()
  313. end)
  314. end
  315. function GetParts(pos, dist)
  316. local parts = {}
  317. local function o(p)
  318. for _,v in pairs(p:children()) do
  319. if v:IsA("BasePart") then
  320. if (pos - v.Position).magnitude <= dist then
  321. table.insert(parts, {v, (pos - v.Position).magnitude, v.Anchored})
  322. end
  323. end
  324. o(v)
  325. end
  326. end
  327. o(workspace)
  328. return parts
  329. end
  330. function GetHum(P)
  331. for _,v in pairs(P:children()) do
  332. if v:IsA("Humanoid") then
  333. if v.Health > 0 then
  334. return v
  335. end
  336. end
  337. end
  338. end
  339. function GetGroup(Pos, Distance, Hit)
  340. local tab = {}
  341. for _,v in pairs(workspace:children()) do
  342. local h = GetHum(v)
  343. local t = v:findFirstChild("Torso")
  344. if h and t and v ~= Hit.Parent then
  345. if (t.Position - Pos).magnitude <= Distance then
  346. table.insert(tab, {h, v, (t.Position - Pos).magnitude})
  347. end
  348. end
  349. end
  350. if Hit then
  351. local h = GetHum(Hit.Parent)
  352. if h then
  353. table.insert(tab, {h, Hit.Parent, 0})
  354. end
  355. end
  356. return tab
  357. end
  358. function Part(Par, Anc, Colli, Tran, Ref, Col, Siz)
  359. local p = Instance.new("Part")
  360. p.formFactor = "Custom"
  361. p.TopSurface = 0
  362. p.BottomSurface = 0
  363. p.Transparency = Tran
  364. p.Reflectance = Ref
  365. p.Anchored = Anc
  366. p.CanCollide = Colli
  367. p.BrickColor = Col
  368. p.Size = Siz
  369. p.Locked = true
  370. p.Parent = Par
  371. p:BreakJoints()
  372. return p
  373. end
  374. function Weld(P0, P1, C0, C1)
  375. local w = Instance.new("Weld")
  376. w.Part0 = P0
  377. w.Part1 = P1
  378. if C0 then
  379. w.C0 = C0
  380. end
  381. if C1 then
  382. w.C1 = C1
  383. end
  384. w.Parent = P0
  385. return w
  386. end
  387. for _,v in pairs(Char:children()) do
  388. if v.Name == ModelName then
  389. v:remove()
  390. end
  391. end
  392. for _,v in pairs(Char:children()) do if v.Name == ModelName then v:remove() end end
  393. Model = Instance.new("Model")
  394. Model.Name = ModelName
  395. FTorso = Part(Model, false, false, 1, 0, Torso.BrickColor, V3(2, 2, 1))
  396. FW = Weld(Torso, FTorso)
  397. RAB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  398. LAB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  399. RLB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  400. LLB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  401. RABW = Weld(Torso, RAB, CN(), CN(-1.5, -0.5, 0))
  402. LABW = Weld(Torso, LAB, CN(), CN(1.5, -0.5, 0))
  403. RLBW = Weld(Torso, RLB, CN(), CN(-0.5, 1, 0))
  404. LLBW = Weld(Torso, LLB, CN(), CN(0.5, 1, 0))
  405. RAW = Weld(RAB, nil, CN(), CN(0, 0.5, 0))
  406. LAW = Weld(LAB, nil, CN(), CN(0, 0.5, 0))
  407. RLW = Weld(RLB, nil, CN(), CN(0, 1, 0))
  408. LLW = Weld(LLB, nil, CN(), CN(0, 1, 0))
  409. TW = Weld(Torso, nil, CN(-0.4, -1.5, 0.7), CA(MR(55), MR(-90), MR(0)))
  410. local FH = Instance.new("Humanoid",Model)
  411. FH.PlatformStand = true
  412. FH.MaxHealth = math.huge
  413. FH.Health = math.huge
  414. pcall(function() Torso:findFirstChild("Shirt"):clone().Parent = Model end)
  415. local hh = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  416. hh.Name = "Head"
  417. Weld(FTorso, hh)
  418. Weapon = Instance.new("Model")
  419. Weapon.Name = "Weapon"
  420. HB = Part(Weapon, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  421. HBW = Weld(Rarm, HB, CN(0, -0.7, 0), CA(MR(-90), MR(180), 0))
  422. HW = Weld(HB, nil, CA(MR(38), MR(-28), MR(-90)) * CN(0, -0.2, -3.8))
  423. LHB = Part(Weapon, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  424. LHBW = Weld(Larm, LHB, CN(0, -0.7, 0), CA(MR(-90), MR(180), 0))
  425. LHW = Weld(LHB, nil, CA(MR(-2), MR(30), MR(-3)) * CN(-0.1, 0.32, -0.24))
  426. LHWK = Weld(LHB, nil, CA(MR(170), 0, 0))
  427. Handle = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.5, 0.9, 0.9))
  428. TW.Part1 = Handle
  429. Handle2 = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.5, 0.6, 1.6))
  430. Weld(Handle, Handle2, CA(MR(-45), 0, 0), CN(0, 0.5, -0.4))
  431. Handle3 = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.5, 0.7, 1.3))
  432. Weld(Handle2, Handle3, CA(MR(45), 0, 0), CN(0, -0.4, -0.9))
  433. Pipe1 = Part(Weapon, false, false, 0, 0.1, BN("Light grey"), V3(0.3, 0.3, 3.2))
  434. Add.Block(Pipe1, V3(1,1,1), 0.08)
  435. Weld(Handle3, Pipe1, CN(0, 0.15, 1.6+0.55))
  436. Pipe2 = Part(Weapon, false, false, 0, 0.1, BN("Light grey"), V3(0.3, 0.3, 1.7))
  437. Add.Block(Pipe2, V3(1,1,1), 0.08)
  438. Weld(Handle3, Pipe2, CN(0, -0.15, 0.85+0.55))
  439. Pipe3 = Part(Weapon, false, false, 0, 0.1, BN("Light grey"), V3(0.25, 0.25, 1.6))
  440. Add.Block(Pipe3, V3(1,1,1), 0.065)
  441. Weld(Pipe2, Pipe3, CN(0, 0, 0.8+0.7))
  442. Pump = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.45, 0.45, 1.1))
  443. Add.Block(Pump, V3(1,1,1), 0.225/2)
  444. PumpWeld = Weld(Pipe2, Pump, CN(0, 0, 0.6), CN(0, 0, 0))
  445. Pump2 = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.5, 0.5, 0.3))
  446. Add.Block(Pump, V3(1,1,1), 0.13)
  447. Weld(Pump, Pump2, CN(0, 0, -0.5))
  448. for degrees = -20, 200, 20 do
  449. local Derp = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.2, 0.2, 0.2))
  450. Add.Block(Derp, V3(0.4,0.6,0.4), 0.02)
  451. Weld(Handle3, Derp, CN(0, -0.45, -0.32) * CA(MR(degrees), 0, 0), CN(0, 0, -0.2))
  452. end
  453. Derp = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.2, 0.2, 0.3))
  454. Add.Block(Derp, V3(0.4,1,1), 0.02)
  455. Weld(Handle3, Derp, CN(0, 0, -0.32) * CA(MR(-20), 0, 0), CN(0, 0.45, -0.2))
  456. Trigger = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.2, 0.3, 0.2))
  457. Add.Block(Trigger, V3(0.5, 0.9, 0.3), 0.02)
  458. TriggerWeld = Weld(Handle3, Trigger, CN(0, -0.45, -0.4) * CA(MR(2), 0, 0))
  459. Aim = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.3, 0.2, 0.7))
  460. Add.Block(Aim, V3(1,0.7,1), 0.05)
  461. Weld(Pipe1, Aim, CN(0, 0.12, 1.1))
  462. Aim1 = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.2, 0.2, 0.2))
  463. Add.Block(Aim1, V3(0.3, 0.7, 0.5))
  464. Weld(Aim, Aim1, CN(-.1, 0.1, -0.25))
  465. Aim2 = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.2, 0.2, 0.2))
  466. Add.Block(Aim2, V3(0.3, 0.7, 0.5))
  467. Weld(Aim, Aim2, CN(.1, 0.1, -0.25))
  468. Aim3 = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.2, 0.2, 0.2))
  469. Add.Block(Aim3, V3(0.3, 0.7, 0.5))
  470. Weld(Aim, Aim3, CN(0, 0.1, 0.25))
  471. BulletFlip = Part(Weapon, false, false, 0, 0, BN("Light grey"), V3(0.2, 0.3, 0.6))
  472. Flip = Weld(Handle3, BulletFlip, CN(-0.18, 0.1, 0.2) * CA(0, MR(-10), 0))
  473. ---POCKET
  474. BeltWelds = {}
  475. BeltK = nil
  476. for i = -0.5, 0.5, 1 do
  477. local Belt = Part(Weapon, false, false, 0, 0, BN("Black"), V3(2.1, 0.3, 0.2))
  478. table.insert(BeltWelds, Weld(Torso, Belt, CN(0, -0.9, i)))
  479. end
  480. for i = 1, -1, -2 do
  481. local Belt = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.2, 0.3, 1.1))
  482. table.insert(BeltWelds, Weld(Torso, Belt, CN(i, -0.9, 0)))
  483. BeltK = Belt
  484. end
  485. for i = -0.25, 0.25, 0.5 do
  486. local Pocket = Part(Weapon, false, false, 0, 0, BN("Black"), V3(1.1, 0.9, 0.2))
  487. table.insert(BeltWelds, Weld(Torso, Pocket, CN(0.8, -1.2, -0.8) * CA(0, MR(-15), 0), CN(0, 0, i)))
  488. end
  489. for i = -0.5, 0.5, 1 do
  490. local Pocket = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.6, 0.9, 0.2))
  491. table.insert(BeltWelds, Weld(Torso, Pocket, CN(0.8, -1.2, -0.8) * CA(0, MR(-15)+MP/2, 0), CN(0, 0, i)))
  492. end
  493. Pocket = Part(Weapon, false, false, 0, 0, BN("Black"), V3(1.1, 0.2, 0.6))
  494. table.insert(BeltWelds, Weld(Torso, Pocket, CN(0.8, -1.6, -0.8) * CA(0, MR(-15), 0)))
  495. function Shell(P)
  496. local Shel = Instance.new("Model")
  497. local Back = Part(Shel, false, false, 0, 0, BN("Bright yellow"), V3(0.3, 0.3, 0.25))
  498. local Main = Part(Shel, false, false, 0, 0, BN("Bright red"), V3(0.3, 0.3, 0.4))
  499. Add.Block(Back, V3(1,1,1), 0.077)
  500. Add.Block(Main, V3(1,1,1), 0.077)
  501. Weld(Main, Back, CN(0, 0, -0.225))
  502. Shel.Parent = P
  503. return {Model = Shel, Back = Back, Main = Main}
  504. end
  505. for y = 0.15, 0.65, 0.25 do
  506. for x = -0.12, 0.13, 0.24 do
  507. for z = -0.25, 0.26, 0.5 do
  508. local sh = Shell(Weapon)
  509. Weld(Pocket, sh.Main, CN(z-0.05, y, x), CA(0, MP/2, 0))
  510. end
  511. end
  512. end
  513. KnifeSheath = Part(Weapon, false, false, 0, 0, BN("Black"), V3(0.3, 0.9, 0.6))
  514. SheathWeld = Weld(BeltK, KnifeSheath, CN(-0.2, -0.3, -0.25) * CA(MR(-20), 0, 0))
  515. KnifeHandle = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.3, 0.6, 0.3))
  516. KnifeWeld = Weld(KnifeSheath, KnifeHandle, CA(MP, 0, 0), CN(0, 0.9, 0))
  517. KnifeHandle2 = Part(Weapon, false, false, 0, 0, BN("Dark grey"), V3(0.3, 0.2, 0.4))
  518. Weld(KnifeHandle, KnifeHandle2, CN(0, 0.35, 0))
  519. KnifeBlade1 = Part(Weapon, false, false, 0, 0.1, BN("Light grey"), V3(0.2, 0.8, 0.3))
  520. Add.Block(KnifeBlade1, V3(0.4, 1, 1), 0.05)
  521. Weld(KnifeHandle2, KnifeBlade1, CN(0, 0.42, 0))
  522. KnifeBlade2 = Part(Weapon, false, false, 0, 0.1, BN("Light grey"), V3(0.2, 0.24, 0.24))
  523. Add.Block(KnifeBlade2, V3(0.4, 1, 1), 0.05)
  524. Weld(KnifeBlade1, KnifeBlade2, CN(0, 0.32, 0), CA(MR(45), 0, 0))
  525. function Show_Damage(P, D, Area)
  526. local mo = Instance.new("Model")
  527. mo.Name = D
  528. local p = Part(mo, true, false, 0, 0, BN("Bright red"), V3(0.2, 0.2, 0.2))
  529. p.Name = "Head"
  530. local m = Instance.new("SpecialMesh")
  531. m.MeshType = "Brick"
  532. m.Scale = Vector3.new(3.5, 2.3, 3.5)
  533. m.Parent = p
  534. local h = Instance.new("Humanoid")
  535. h.Health = 0
  536. h.MaxHealth = 0
  537. h.Name = "asd"
  538. h.Parent = mo
  539. local nah = true
  540. mo.Parent = workspace
  541. local cf = CN(P) * CN(MRA(-Area*100, Area*100)/100, MRA(-Area*100, Area*100)/100, MRA(-Area*100, Area*100)/100)
  542. p.CFrame = cf
  543. Notime(function()
  544. Notime(function()
  545. for i = 0, 6, 0.03 do
  546. wait()
  547. p.CFrame = cf * CN(0, i, 0)
  548. end
  549. end)
  550. wait(1.5)
  551. for i = 0, 1, 0.05 do
  552. p.Transparency = i
  553. if nah then mo.Name = "" nah = false else mo.Name = "- "..D nah = true end
  554. wait()
  555. end
  556. mo:remove()
  557. end)
  558. end
  559. function Hit(part)
  560. local H = GetHum(part.Parent)
  561. if H and Debounce and Hurt then
  562. Debounce = false
  563. local Dmg = MRA(MeleeDmg/1.3, MeleeDmg)
  564. H.Health = H.Health - Dmg
  565. Show_Damage(KnifeBlade2.Position, Dmg, 0.1)
  566. end
  567. end
  568. KnifeBlade1.Touched:connect(Hit)
  569. KnifeBlade2.Touched:connect(Hit)
  570. Weapon.Parent = Model
  571. Model.Parent = Char
  572. if script.Parent.className ~= "HopperBin" then
  573. h = Instance.new("HopperBin", Me.Backpack)
  574. h.Name = ToolName
  575. script.Parent = h
  576. end
  577. bin = script.Parent
  578. function Attach(t)
  579. RSH.Part0 = t
  580. LSH.Part0 = t
  581. RH.Part0 = t
  582. LH.Part0 = t
  583. RABW.Part0 = t
  584. LABW.Part0 = t
  585. LLBW.Part0 = t
  586. RLBW.Part0 = t
  587. for _,v in pairs(BeltWelds) do
  588. v.Part0 = t
  589. end
  590. if t == Torso then
  591. FTorso.Transparency = 1
  592. else
  593. Torso.Transparency = 1
  594. end
  595. t.Transparency = 0
  596. end
  597. function Normal()
  598. RAW.C0 = CA(MR(90), 0, MR(-65)) * CN(0.6, -0.9, 0)
  599. LAW.C0 = CA(MR(85), 0, MR(-40)) * CN(0.5, -0.5, 0)
  600. FW.C0 = CA(0, MR(-70), 0)
  601. HW.C0 = CA(MR(0), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  602. LHW.C0 = CA(MR(-2), MR(30), MR(-3)) * CN(-0.1, 0.32, -0.24)
  603. PumpWeld.C1 = CN(0, 0, 0)
  604. Flip.C1 = CN(0, 0, 0)
  605. Attach(FTorso)
  606. LHW.Part1 = nil
  607. TW.Part1 = nil
  608. LHWK.Part1 = nil
  609. KnifeWeld.Part1 = KnifeHandle
  610. Neck.C0 = necko
  611. HW.Part1 = Handle
  612. end
  613. function Swing()
  614. Swinging = true
  615. for i = 0.5, 1, 0.5 do
  616. LAW.C0 = CA(MR(85-8*i), 0, MR(-40+5*i)) * CN(0.5, -0.5+0.2*i, 0)
  617. RAW.C0 = CA(MR(90-5*i), 0, MR(-65-5*i)) * CN(0.6+0.05*i, -0.9+0.05*i, -0.1*i)
  618. HW.C0 = CA(MR(-5*i), MR(5+5*i), MR(0)) * CN(0.4, 0, -1.2)
  619. FW.C0 = CA(0, MR(-70+8*i), 0)
  620. wait()
  621. end
  622. for i = 0.33, 1, 0.33 do
  623. LAW.C0 = CA(MR(77-37*i), 0, MR(-35+30*i)) * CN(0.5-0.15*i, -0.3+0.3*i, 0)
  624. RAW.C0 = CA(MR(85-15*i), 0, MR(-70-5*i)) * CN(0.65+0.15*i, -0.85+0.2*i, -0.1-0.2*i)
  625. HW.C0 = CA(MR(-5-15*i), MR(10+10*i), MR(0)) * CN(0.4, 0, -1.2)
  626. FW.C0 = CA(0, MR(-62+58*i), 0)
  627. wait()
  628. end
  629. LHWK.Part1 = KnifeHandle
  630. KnifeWeld.Part1 = nil
  631. PlaySound(Sounds.Slash)
  632. for i = 0.25, 1, 0.25 do
  633. LAW.C0 = CA(MR(40+30*i), 0, MR(-5-45*i)) * CN(0.35-0.2*i, -0.5*i, 0)
  634. RAW.C0 = CA(MR(70-15*i), 0, MR(-75-5*i)) * CN(0.8, -0.65+0.15*i, -0.3-0.05*i)
  635. HW.C0 = CA(MR(-20-10*i), MR(20+5*i), MR(0)) * CN(0.4, 0, -1.2)
  636. FW.C0 = CA(0, MR(-4+14*i), 0)
  637. LHWK.C0 = CN(0, -0.1*i, 0.2*i) * CA(MR(170), 0, MR(-50*i))
  638. wait()
  639. end
  640. Hurt = true
  641. Debounce = true
  642. for i = 0.25, 1, 0.25 do
  643. LAW.C0 = CA(MR(70+20*i), 0, MR(-50+35*i)) * CN(0.15-0.05*i, -0.5-0.3*i, 0)
  644. FW.C0 = CA(0, MR(10-60*i), 0)
  645. LHWK.C0 = CN(0, -0.1-0.05*i, 0.2+0.1*i) * CA(MR(170), 0, MR(-50-40*i))
  646. wait()
  647. end
  648. for i = 0.25, 1, 0.25 do
  649. LAW.C0 = CA(MR(90+10*i), 0, MR(-15+15*i)) * CN(0.1, -0.9, 0)
  650. FW.C0 = CA(0, MR(-50-40*i), 0)
  651. LHWK.C0 = CN(0, -0.15, 0.3) * CA(MR(170), 0, MR(-90))
  652. wait()
  653. end
  654. for i = 0.33, 1, 0.33 do
  655. LAW.C0 = CA(MR(100+3*i), 0, 0) * CN(0.1, -0.9, 0)
  656. FW.C0 = CA(0, MR(-90-6*i), 0)
  657. LHWK.C0 = CN(0, -0.15, 0.3) * CA(MR(170), 0, MR(-90))
  658. wait()
  659. end
  660. Hurt = false
  661. wait(0.04)
  662. for i = 0.25, 1, 0.25 do
  663. LAW.C0 = CA(MR(103-13*i), 0, 0) * CN(0.1, -0.9+0.1*i, 0)
  664. FW.C0 = CA(0, MR(-96+16*i), 0)
  665. LHWK.C0 = CN(0, -0.15, 0.3-0.1*i) * CA(MR(170), 0, MR(-90+15*i))
  666. wait()
  667. end
  668. for i = 0.25, 1, 0.25 do
  669. LAW.C0 = CA(MR(90-42*i), 0, 0) * CN(0.1+0.1*i, -0.8+0.3*i, 0)
  670. RAW.C0 = CA(MR(55+15*i), 0, MR(-80+5*i)) * CN(0.8-0.05*i, -0.5-0.1*i, -0.35+0.05*i)
  671. FW.C0 = CA(0, MR(-80+10*i), 0)
  672. HW.C0 = CA(MR(-30+20*i), MR(25-15*i), MR(0)) * CN(0.4, 0, -1.2)
  673. LHWK.C0 = CN(0, -0.15, 0.2-0.45*i) * CA(MR(170), 0, MR(-75+75*i))
  674. wait()
  675. end
  676. for i = 0.5, 1, 0.5 do
  677. LAW.C0 = CA(MR(48-8*i), 0, 0) * CN(0.2+0.05*i, -0.5, 0)
  678. RAW.C0 = CA(MR(70+10*i), 0, MR(-75+7*i)) * CN(0.75-0.05*i, -0.6-0.1*i, -0.3+0.05*i)
  679. FW.C0 = CA(0, MR(-70), 0)
  680. HW.C0 = CA(MR(-10+10*i), MR(10-5*i), MR(0)) * CN(0.4, 0, -1.2)
  681. LHWK.C0 = CN(0, -0.15, -0.25-0.15*i) * CA(MR(170), 0, 0)
  682. wait()
  683. end
  684. LHWK.Part1 = nil
  685. KnifeWeld.Part1 = KnifeHandle
  686. for i = 0.25, 1, 0.25 do
  687. LAW.C0 = CA(MR(40+40*i), 0, MR(-30*i)) * CN(0.25+0.2*i, -0.5, 0)
  688. RAW.C0 = CA(MR(80+10*i), 0, MR(-68+3*i)) * CN(0.7-0.1*i, -0.7-0.2*i, -0.25+0.2*i)
  689. wait()
  690. end
  691. for i = 0.5, 1, 0.5 do
  692. LAW.C0 = CA(MR(80+5*i), 0, MR(-30-10*i)) * CN(0.45+0.05*i, -0.5, -0.05+0.05*i)
  693. RAW.C0 = CA(MR(90), 0, MR(-65)) * CN(0.6, -0.9, 0)
  694. wait()
  695. end
  696. Normal()
  697. Swinging = false
  698. end
  699. function Reload(once)
  700. while Ammunition.Ammo < Ammunition.MaxAmmo and Ammunition.Ammoleft > 0 do
  701. wait()
  702. for i = 0.33, 1, 0.33 do
  703. RAW.C0 = CA(MR(45-2*i), 0, MR(-15)) * CN(0, -0.15-0.05*i, 0)
  704. LAW.C0 = CA(MR(50), MR(40), MR(-15)) * CN(0.5, -0.5, 0)
  705. LHW.C0 = CA(MR(-35), MR(60), MR(-45)) * CN(-0.6, 0.2, -0.24)
  706. wait()
  707. end
  708. for i = 0.25, 1, 0.25 do
  709. RAW.C0 = CA(MR(43-8*i), 0, MR(-15)) * CN(0, -0.2-0.2*i, 0)
  710. LAW.C0 = CA(MR(50), MR(40), MR(-15)) * CN(0.5, -0.5, 0)
  711. LHW.C0 = CA(MR(-35), MR(60), MR(-45)) * CN(-0.6, 0.2, -0.24)
  712. wait()
  713. end
  714. for i = 0.5, 1, 0.5 do
  715. RAW.C0 = CA(MR(35-2*i), 0, MR(-15)) * CN(0, -0.4-0.05*i, 0)
  716. wait()
  717. end
  718. local shel = Shell(Weapon)
  719. local w = Weld(Rarm, shel.Main, CN(0, -1.25, 0.45), CA(MR(-140), 0, MR(60)))
  720. for i = 0.25, 1, 0.25 do
  721. RAW.C0 = CA(MR(33+20*i), 0, MR(-15-10*i)) * CN(0, -0.45+0.2*i, 0)
  722. LAW.C0 = CA(MR(50-5*i), MR(40), MR(-15+5*i)) * CN(0.5, -0.5, 0)
  723. w.C0 = CN(-0.1*i, -1.25, 0.45-0.25*i)
  724. wait()
  725. end
  726. for i = 0.2, 1, 0.2 do
  727. RAW.C0 = CA(MR(53+32*i), 0, MR(-25-12*i)) * CN(0, -0.25-0.3*i, 0)
  728. LAW.C0 = CA(MR(45), MR(40), MR(-10+10*i)) * CN(0.5, -0.5+0.15*i, 0)
  729. w.C0 = CN(-0.1-0.1*i, -1.25, 0.2-0.3*i)
  730. w.C1 = CA(MR(-140+50*i), 0, MR(60))
  731. wait()
  732. end
  733. PlaySound(Sounds.Reload, false)
  734. for i = 0.25, 1, 0.25 do
  735. RAW.C0 = CA(MR(85+10*i), 0, MR(-42-8*i)) * CN(0, -0.55-0.1*i, 0)
  736. LAW.C0 = CA(MR(45), MR(40), 0) * CN(0.5, -0.35, 0)
  737. w.C0 = CN(-0.2-0.05*i, -1.25, -0.1-0.1*i)
  738. wait()
  739. end
  740. shel.Model:remove() shell = nil
  741. Ammunition.Ammo = Ammunition.Ammo + 1
  742. Ammunition.Ammoleft = Ammunition.Ammoleft - 1
  743. wait(0.1)
  744. for i = 0.33, 1, 0.33 do
  745. RAW.C0 = CA(MR(95-10*i), 0, MR(-50+10*i)) * CN(0, -0.65+0.1*i, 0)
  746. LAW.C0 = CA(MR(45+5*i), MR(40), MR(-12*i)) * CN(0.5, -0.35-0.1*i, 0)
  747. wait()
  748. end
  749. for i = 0.25, 1, 0.25 do
  750. RAW.C0 = CA(MR(85-40*i), 0, MR(-40+25*i)) * CN(0, -0.55+0.4*i, 0)
  751. LAW.C0 = CA(MR(50), MR(40), MR(-12-3*i)) * CN(0.5, -0.45-0.05*i, 0)
  752. wait()
  753. end
  754. if once then break end
  755. if not ReloadHold then break end
  756. end
  757. for i = 0.33, 1, 0.33 do
  758. RAW.C0 = CA(MR(45+10*i), 0, MR(-15-10*i)) * CN(0.1*i, -0.15-0.1*i, 0)
  759. LAW.C0 = CA(MR(52+12*i), MR(40-5*i), MR(-15-5*i)) * CN(0.5, -0.5, 0)
  760. LHW.C0 = CA(MR(-35+10*i), MR(60-10*i), MR(-45+10*i)) * CN(-0.6+0.1*i, 0.2, -0.24)
  761. wait()
  762. end
  763. for i = 0.2, 1, 0.2 do
  764. RAW.C0 = CA(MR(55+30*i), 0, MR(-25-30*i)) * CN(0.1+0.4*i, -0.25-0.55*i, 0)
  765. LAW.C0 = CA(MR(70+10*i), MR(35-30*i), MR(-20-15*i)) * CN(0.5, -0.5, 0)
  766. LHW.C0 = CA(MR(-25+18*i), MR(50-15*i), MR(-35+25*i)) * CN(-0.5+0.3*i, 0.2+0.1*i, -0.24)
  767. wait()
  768. end
  769. for i = 0.25, 1, 0.25 do
  770. RAW.C0 = CA(MR(85+5*i), 0, MR(-55-10*i)) * CN(0.5+0.1*i, -0.8-0.1*i, 0)
  771. LAW.C0 = CA(MR(80+5*i), MR(5-5*i), MR(-35-5*i)) * CN(0.5, -0.5, 0)
  772. LHW.C0 = CA(MR(-7+5*i), MR(35-5*i), MR(-10+7*i)) * CN(-0.2+0.1*i, 0.3+0.02*i, -0.24)
  773. wait()
  774. end
  775. end
  776. function ReloadStart(once)
  777. Reloading = true
  778. HW.Part1 = nil
  779. LHW.Part1 = Pipe2
  780. for i = 0.25, 1, 0.25 do
  781. RAW.C0 = CA(MR(90-10*i), 0, MR(-65+10*i)) * CN(0.6-0.2*i, -0.9+0.15*i, 0)
  782. LAW.C0 = CA(MR(85-5*i), MR(7*i), MR(-40+5*i)) * CN(0.5, -0.5, 0)
  783. LHW.C0 = CA(MR(-2-8*i), MR(30+5*i), MR(-3-12*i)) * CN(-0.1-0.1*i, 0.32-0.12*i, -0.24)
  784. wait()
  785. end
  786. for i = 0.15, 1, 0.15 do
  787. RAW.C0 = CA(MR(80-35*i), 0, MR(-55+40*i)) * CN(0.4-0.4*i, -0.75+0.6*i, 0)
  788. LAW.C0 = CA(MR(80-30*i), MR(7+33*i), MR(-35+20*i)) * CN(0.5, -0.5, 0)
  789. LHW.C0 = CA(MR(-10-25*i), MR(35+25*i), MR(-15-30*i)) * CN(-0.2-0.4*i, 0.2, -0.24)
  790. wait()
  791. end
  792. Reload(once)
  793. Normal()
  794. Reloading = false
  795. end
  796. function AimEet()
  797. end
  798. function Shoot(Start, To)
  799. local Accu = CA(MR(MRA(-Accuracy.Momentum*1000, Accuracy.Momentum*1000)/1700), MR(MRA(-Accuracy.Momentum*1000, Accuracy.Momentum*1000)/1000), MR(MRA(-Accuracy.Momentum*1000, Accuracy.Momentum*1000)/1000))
  800. for Pellets = 1, 8 do
  801. local Power = 20
  802. local Drop = 0.2
  803. local Face = CN(Start, To) * Accu * CA(MR(MRA(-10000, 10000)/2500), MR(MRA(-10000, 10000)/2500), MR(MRA(-10000, 10000)/2500))
  804. local Pellet = Part(PelletModel, true, false, 0, 0, BN("Dark grey"), V3(0.2, 0.2, 0.3))
  805. Pellet.CFrame = Face
  806. local LastPoint = Face.p
  807. Notime(function()
  808. local HitObj
  809. local HitPos
  810. local DistThing = 250
  811. for Distance = Power, 600, Power do
  812. Face = Face * CA(MR(-Drop), 0, 0) * CN(0, 0, -Power)
  813. local PointNow = Face.p
  814. local Hit, Pos = RayC(LastPoint, PointNow, Power+2, EffectModel)
  815. if Hit then
  816. DistThing = Distance
  817. if DistThing > 250 then DistThing = 200 end
  818. PointNow = Pos
  819. HitPos = Pos
  820. HitObj = Hit
  821. end
  822. local Dist = (PointNow - LastPoint).magnitude
  823. Pellet.CFrame = Face
  824. Drop = Drop + 0.04
  825. local Effect = Part(EffectModel, true, false, 0, 0, BN("White"), V3(0.2, 0.2, 0.2))
  826. Effect.CFrame = CN(LastPoint, PointNow) * CA(MR(-90), 0, 0) * CN(0, Dist/2, 0)
  827. local H = Add.Head(Effect, V3(0.8, Dist*5, 0.8))
  828. LastPoint = Face.p
  829. Power = Power - Drop/3
  830. Notime(function()
  831. for i = 0, 1, 0.2 do
  832. wait()
  833. Effect.Transparency = i
  834. end
  835. Effect:remove()
  836. end)
  837. if Hit then
  838. Pellet.CFrame = CN(Pos)
  839. break
  840. end
  841. wait()
  842. end
  843. Pellet:remove()
  844. if HitObj then
  845. local Surface = DetectSurface(HitPos, HitObj)
  846. local C = CN(HitPos) * CA(HitObj.CFrame:toEulerAnglesXYZ()) * Surface[2]
  847. if Surface[1] == "Anything" then
  848. C = Surface[2]
  849. end
  850. local H = nil
  851. if HitObj.Parent ~= workspace then
  852. H = GetHum(HitObj.Parent)
  853. if HitObj.Parent.Parent ~= workspace and H == nil then
  854. H = GetHum(HitObj.Parent.Parent)
  855. end
  856. end
  857. if H then
  858. local Dmg = DistThing/200
  859. Dmg = (1-Dmg)*15
  860. Dmg = MRA(Dmg*850, Dmg*1100)/1000
  861. H.Health = H.Health - Dmg
  862. PlaySound(Sounds.Hit)
  863. Show_Damage(HitObj.Position, math.floor(Dmg), 1.5)
  864. else
  865. PlaySound(Sounds.PartHit)
  866. local BulletHole = Part(EffectModel, true, false, 1, 0, BN("White"), V3(0.8, 0.2, 0.8))
  867. BulletHole.CFrame = C * CN(0, -0.085, 0)
  868. local Dec = Instance.new("Decal",BulletHole)
  869. Dec.Texture = Images[MRA(1,#Images)]
  870. Dec.Face = "Top"
  871. if not HitObj.Anchored then
  872. BulletHole.Anchored = false
  873. local W = Weld(HitObj, BulletHole, HitObj.CFrame:toObjectSpace(C))
  874. end
  875. Notime(function()
  876. wait(MRA(700, 15000)/100)
  877. BulletHole:remove()
  878. end)
  879. end
  880. end
  881. end)
  882. end
  883. end
  884. function ShootAnim(From, To)
  885. Shoot(From, To)
  886. AddInaccuracy(16)
  887. PlaySound(Sounds.Fire, false)
  888. for i = 0.33, 1, 0.33 do
  889. RAW.C0 = CA(MR(90+10*i), 0, MR(-65)) * CN(0.6, -0.9+0.5*i, 0)
  890. LAW.C0 = CA(MR(85+26*i), 0, MR(-40)) * CN(0.5, -0.5+0.1*i, 0)
  891. HW.C0 = CA(MR(-15*i), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  892. wait()
  893. end
  894. for i = 0.2, 1, 0.2 do
  895. RAW.C0 = CA(MR(100+5*i), 0, MR(-65)) * CN(0.6, -0.4+0.15*i, 0)
  896. LAW.C0 = CA(MR(111+4*i), 0, MR(-40)) * CN(0.5, -0.4+0.05*i, 0)
  897. HW.C0 = CA(MR(-15-2*i), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  898. wait()
  899. end
  900. for i = 0.5, 1, 0.5 do
  901. RAW.C0 = CA(MR(105+2*i), 0, MR(-65)) * CN(0.6, -0.25+0.03*i, 0)
  902. LAW.C0 = CA(MR(115+2*i), 0, MR(-40)) * CN(0.5, -0.35+0.02*i, 0)
  903. HW.C0 = CA(MR(-17), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  904. wait()
  905. end
  906. for i = 0.2, 1, 0.2 do
  907. RAW.C0 = CA(MR(107-12*i), 0, MR(-65)) * CN(0.6, -0.22-0.68*i, 0)
  908. LAW.C0 = CA(MR(117-17*i), 0, MR(-40)) * CN(0.5, -0.33-0.02*i, 0)
  909. HW.C0 = CA(MR(-17+2*i), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  910. wait()
  911. end
  912. for i = 0.33, 1, 0.33 do
  913. RAW.C0 = CA(MR(95-5*i), 0, MR(-65)) * CN(0.6, -0.9-0.1*i, 0)
  914. LAW.C0 = CA(MR(100-5*i), 0, MR(-40)) * CN(0.5+0.1*i, -0.35+0.1*i, 0)
  915. HW.C0 = CA(MR(-15+11*i), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  916. PumpWeld.C1 = CN(0, 0, 0.1*i)
  917. wait()
  918. end
  919. for i = 0.33, 1, 0.33 do
  920. RAW.C0 = CA(MR(90-3*i), 0, MR(-65)) * CN(0.6, -1+0.05*i, 0)
  921. LAW.C0 = CA(MR(95-5*i), 0, MR(-40)) * CN(0.6+0.2*i, -0.25+0.35*i, 0)
  922. HW.C0 = CA(MR(-4+4*i), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  923. PumpWeld.C1 = CN(0, 0, 0.1+0.6*i)
  924. Flip.C1 = CN(0, 0, 0.5*i)
  925. wait()
  926. end
  927. local sh = Shell(workspace)
  928. sh.Main.CanCollide = true
  929. sh.Back.CanCollide = true
  930. sh.Main.CFrame = Handle3.CFrame * CN(0.3, 0.2, 0)
  931. sh.Main.Velocity = (Handle3.CFrame * CA(0, MR(90), 0)).lookVector * 15
  932. Notime(function()
  933. wait(MRA(100,180)/10)
  934. for i = 0, 1, 0.005 do
  935. sh.Main.Transparency = i
  936. sh.Back.Transparency = i
  937. wait()
  938. end
  939. sh.Model:remove()
  940. end)
  941. for i = 0.33, 1, 0.33 do
  942. RAW.C0 = CA(MR(87+3*i), 0, MR(-65)) * CN(0.6, -0.95+0.05*i, 0)
  943. LAW.C0 = CA(MR(90-5*i), 0, MR(-40)) * CN(0.8-0.3*i, 0.1-0.6*i, 0)
  944. HW.C0 = CA(0, MR(5), 0) * CN(0.4, 0, -1.2)
  945. PumpWeld.C1 = CN(0, 0, 0.7-0.7*i)
  946. Flip.C1 = CN(0, 0, 0.5-0.5*i)
  947. wait()
  948. end
  949. Normal()
  950. end
  951. function ShootFunc(From, To)
  952. local H, Pos = RayC(From, To, 10, EffectModel)
  953. local Can = true
  954. if H then
  955. if H:IsDescendantOf(Char) then
  956. Can = false
  957. end
  958. end
  959. if Can then
  960. Attacking = true
  961. Ammunition.Ammo = Ammunition.Ammo - 1
  962. if Ammunition.Ammo < 0 then Ammunition.Ammo = 0 end
  963. ShootAnim(From, To)
  964. Attacking = false
  965. end
  966. end
  967. function SelectAnim()
  968. RAW.Part1 = Rarm
  969. for i = 0.25, 1, 0.25 do
  970. RAW.C0 = CA(MR(-10*i), 0, MR(2*i))
  971. wait()
  972. end
  973. for i = 0.1, 1, 0.1 do
  974. RAW.C0 = CN(-0.15*i, 0, -0.45*i) * CA(MR(-10-115*i), 0, MR(2+8*i)) * CN(0, -0.4*i, 0)
  975. wait()
  976. end
  977. for i = 0.25, 1, 0.25 do
  978. RAW.C0 = CN(-0.15, 0, -0.45-0.05*i) * CA(MR(-125-15*i), 0, MR(10)) * CN(0, -0.4, 0)
  979. wait()
  980. end
  981. TW.Part1 = nil
  982. HW.Part1 = Handle
  983. for i = 0.25, 1, 0.25 do
  984. RAW.C0 = CN(-0.15+0.15*i, 0, -0.5+0.1*i) * CA(MR(-140+10*i), 0, MR(10+2*i)) * CN(0, -0.4+0.15*i, 0)
  985. HW.C0 = CA(MR(38+12*i), MR(-28-15*i), MR(-90-10*i)) * CN(0, -0.1*i, -3.8)
  986. wait()
  987. end
  988. Attach(FTorso)
  989. for i = 0.1, 1, 0.1 do
  990. RAW.C0 = CN(0, 0, -0.4+0.3*i) * CA(MR(-130+90*i), 0, MR(12+30*i)) * CN(0, -0.25+0.25*i, 0)
  991. HW.C0 = CA(MR(50+30*i), MR(-43-50*i), MR(-100-50*i)) * CN(0, -0.1-0.7*i, -3.8+0.7*i)
  992. FW.C0 = CA(0, MR(-15*i), 0)
  993. wait()
  994. end
  995. LAW.Part1 = Larm
  996. for i = 0.15, 1, 0.15 do
  997. RAW.C0 = CN(0, 0, -0.1+0.1*i) * CA(MR(-40+60*i), 0, MR(42+4*i))
  998. LAW.C0 = CA(MR(10*i), 0, MR(-8*i)) * CN(0, -0.15*i, 0)
  999. FW.C0 = CA(0, MR(-15-20*i), 0)
  1000. HW.C0 = CA(MR(80+50*i), MR(-93-57*i), MR(-150-30*i)) * CN(0, -0.8, -3.1+1*i)
  1001. wait()
  1002. end
  1003. for i = 0.15, 1, 0.15 do
  1004. RAW.C0 = CA(MR(20+58*i), 0, MR(46-60*i)) * CN(0.2*i, -0.35*i, 0)
  1005. LAW.C0 = CA(MR(10+65*i), 0, MR(-8-32*i)) * CN(0.3*i, -0.15-0.25*i, 0)
  1006. FW.C0 = CA(0, MR(-35-30*i), 0)
  1007. HW.C0 = CA(MR(130+50*i), MR(-150-20*i), MR(-180)) * CN(0.25*i, -0.8+0.3*i, -2.1+0.9*i)
  1008. wait()
  1009. end
  1010. for i = 0.2, 1, 0.2 do
  1011. RAW.C0 = CA(MR(78+8*i), 0, MR(-14-41*i)) * CN(0.2+0.35*i, -0.35-0.55*i, 0)
  1012. LAW.C0 = CA(MR(75+7*i), 0, MR(-40)) * CN(0.3+0.15*i, -0.4-0.06*i, 0)
  1013. FW.C0 = CA(0, MR(-65-5*i), 0)
  1014. HW.C0 = CA(MR(0), MR(-10+10*i), MR(0)) * CN(0.25+0.1*i, -0.5+0.4*i, -1.2)
  1015. wait()
  1016. end
  1017. for i = 0.25, 1, 0.25 do
  1018. RAW.C0 = CA(MR(86+4*i), 0, MR(-55-10*i)) * CN(0.55+0.05*i, -0.8-0.1*i, 0)
  1019. LAW.C0 = CA(MR(82+3*i), 0, MR(-40)) * CN(0.45+0.05*i, -0.46-0.04*i, 0)
  1020. FW.C0 = CA(0, MR(-70), 0)
  1021. HW.C0 = CA(MR(0), MR(5*i), MR(0)) * CN(0.35+0.05*i, -0.1+0.1*i, -1.2)
  1022. wait()
  1023. end
  1024. end
  1025. function DeselAnim()
  1026. for i = 0.25, 1, 0.25 do
  1027. RAW.C0 = CA(MR(90-10*i), 0, MR(-65+10*i)) * CN(0.6-0.05*i, -0.9+0.35*i, 0)
  1028. LAW.C0 = CA(MR(85-10*i), 0, MR(-40+4*i)) * CN(0.5-0.05*i, -0.5+0.04*i, 0)
  1029. FW.C0 = CA(0, MR(-70+10*i), 0)
  1030. HW.C0 = CA(MR(180-10*i), MR(-185+10*i), MR(180-10*i)) * CN(0.4-0.05*i, -0.1*i, -1.2)
  1031. wait()
  1032. end
  1033. for i = 0.07, 1, 0.07 do
  1034. RAW.C0 = CA(MR(80-80*i), 0, MR(-55+90*i)) * CN(0.55-0.35*i, -0.55+0.55*i, 0)
  1035. LAW.C0 = CA(MR(75-70*i), 0, MR(-36+30*i)) * CN(0.45-0.35*i, -0.46+0.36*i, 0)
  1036. FW.C0 = CA(0, MR(-60+40*i), 0)
  1037. HW.C0 = CA(MR(170-70*i), MR(-175+70*i), MR(170-70*i)) * CN(0.35-0.35*i, -0.1-0.1*i, -1.2-1*i)
  1038. wait()
  1039. end
  1040. for i = 0.25, 1, 0.25 do
  1041. RAW.C0 = CN(-0.1*i, 0, -0.15*i) * CA(MR(-30*i), 0, MR(35+10*i)) * CN(0.2-0.2*i, 0, 0)
  1042. LAW.C0 = CA(MR(5-5*i), 0, MR(-6+6*i)) * CN(0.1-0.1*i, -0.1+0.1*i, 0)
  1043. FW.C0 = CA(0, MR(-20+15*i), 0)
  1044. HW.C0 = CA(MR(100-20*i), MR(-105+15*i), MR(100-15*i)) * CN(0, -0.2, -2.2-0.3*i)
  1045. wait()
  1046. end
  1047. LAW.Part1 = nil
  1048. for i = 0.12, 1, 0.12 do
  1049. RAW.C0 = CN(-0.1-0.05*i, 0, -0.15-0.3*i) * CA(MR(-30-100*i), 0, MR(45-30*i)) * CN(0, -0.3*i, 0)
  1050. FW.C0 = CA(0, MR(-5+5*i), 0)
  1051. HW.C0 = CA(MR(80-37*i), MR(-90+55*i), MR(85-135*i)) * CN(0, -0.2, -2.5-0.9*i)
  1052. wait()
  1053. end
  1054. Attach(Torso)
  1055. for i = 0.2, 1, 0.2 do
  1056. RAW.C0 = CN(-0.15*i, 0, -0.45-0.05*i) * CA(MR(-130-10*i), 0, MR(15-5*i)) * CN(0, -0.3-0.1*i, 0)
  1057. HW.C0 = CA(MR(43-5*i), MR(-35+7*i), MR(-50-40*i)) * CN(0, -0.2, -3.4-0.4*i)
  1058. wait()
  1059. end
  1060. TW.Part1 = Handle
  1061. HW.Part1 = nil
  1062. for i = 0.25, 1, 0.25 do
  1063. RAW.C0 = CN(-0.15+0.05*i, 0, -0.5+0.15*i) * CA(MR(-140+10*i), 0, MR(10-3*i)) * CN(0, -0.4+0.1*i, 0)
  1064. wait()
  1065. end
  1066. for i = 0.15, 1, 0.15 do
  1067. RAW.C0 = CN(-0.1+0.1*i, 0, -0.35+0.25*i) * CA(MR(-130+115*i), 0, MR(7-7*i)) * CN(0, -0.3+0.25*i, 0)
  1068. wait()
  1069. end
  1070. for i = 0.33, 1, 0.33 do
  1071. RAW.C0 = CN(0, 0, -0.1+0.1*i) * CA(MR(-15+15*i), 0, 0) * CN(0, -0.05+0.05*i, 0)
  1072. wait()
  1073. end
  1074. Attach(Torso)
  1075. TW.Part1 = Handle
  1076. HW.Part1 = nil
  1077. RAW.Part1 = nil
  1078. LAW.Part1 = nil
  1079. end
  1080. function ReloadFunc(once)
  1081. if Ammunition.Ammo < Ammunition.MaxAmmo and Selected and not Reloading and not Attacking and Ammunition.Ammoleft > 0 then
  1082. if not once then
  1083. ReloadHold = true
  1084. end
  1085. ReloadStart(once)
  1086. end
  1087. end
  1088. function onSelected(mouse)
  1089. SelectAnim()
  1090. mouse.Icon = Icon
  1091. Selected = true
  1092. Notime(function()
  1093. for _, g in pairs(AccuracyGuis) do
  1094. g.Gui.Transparency = 0.2
  1095. end
  1096. while Selected do
  1097. pcall(function()
  1098. for _, g in pairs(AccuracyGuis) do
  1099. g.Gui.Position = UD(0, mouse.X+g.props.offset.x+g.props.unit.x*(Accuracy.Momentum*11), 0, mouse.Y+g.props.offset.y+g.props.unit.y*(Accuracy.Momentum*11))
  1100. end
  1101. end)
  1102. wait()
  1103. end
  1104. end)
  1105. mouse.Button1Down:connect(function()
  1106. if Selected and not Attacking and not Swinging then
  1107. if Reloading then
  1108. ReloadHold = false
  1109. else
  1110. if Ammunition.Ammo < 1 then
  1111. ReloadFunc(true)
  1112. else
  1113. ShootFunc((Pipe1.CFrame * CN(0, 0, 1.65)).p, mouse.Hit.p)
  1114. end
  1115. if Ammunition.Ammo < 1 and Ammunition.Ammoleft < 1 then
  1116. PlaySound(Sounds.Out)
  1117. end
  1118. end
  1119. end
  1120. end)
  1121. mouse.KeyDown:connect(function(key)
  1122. key = key:lower()
  1123. if Selected and not Attacking and not Swinging then
  1124. if key == "r" then
  1125. ReloadFunc()
  1126. elseif key == "e" then
  1127. Swing()
  1128. end
  1129. end
  1130. end)
  1131. mouse.KeyUp:connect(function(key)
  1132. key = key:lower()
  1133. if key == "r" then
  1134. ReloadHold = false
  1135. end
  1136. end)
  1137. end
  1138. function onDeselected(mouse)
  1139. Selected = false
  1140. for _, g in pairs(AccuracyGuis) do
  1141. g.Gui.Transparency = 1
  1142. end
  1143. DeselAnim()
  1144. end
  1145. bin.Selected:connect(onSelected)
  1146. bin.Deselected:connect(onDeselected)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement