Advertisement
benli45

Untitled

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