Advertisement
memberhero

Untitled

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