Advertisement
Ban43_GodOfEdits

GUN BOI

Jun 27th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 54.11 KB | None | 0 0
  1. -- Created by Nebula_Zorua --
  2. -- Assault Rifle --
  3. -- A lil assault rifle --
  4. -- Discord: Nebula the Zorua#6969
  5. -- Youtube: https://www.youtube.com/channel/UCo9oU9dCw8jnuVLuy4_SATA
  6.  
  7. wait(1/60)
  8.  
  9.  
  10. --// Shortcut Variables \\--
  11. local S = setmetatable({},{__index = function(s,i) return game:service(i) end})
  12. local CF = {N=CFrame.new,A=CFrame.Angles,fEA=CFrame.fromEulerAnglesXYZ}
  13. local C3 = {N=Color3.new,RGB=Color3.fromRGB,HSV=Color3.fromHSV,tHSV=Color3.toHSV}
  14. local V3 = {N=Vector3.new,FNI=Vector3.FromNormalId,A=Vector3.FromAxis}
  15. local M = {C=math.cos,R=math.rad,S=math.sin,P=math.pi,RNG=math.random,MRS=math.randomseed,H=math.huge,RRNG = function(min,max,div) return math.rad(math.random(min,max)/(div or 1)) end}
  16. local R3 = {N=Region3.new}
  17. local De = S.Debris
  18. local WS = workspace
  19. local Lght = S.Lighting
  20. local RepS = S.ReplicatedStorage
  21. local IN = Instance.new
  22. local Plrs = S.Players
  23.  
  24. --// Initializing \\--
  25. local Plr = Plrs.LocalPlayer
  26. local Char = Plr.Character
  27. local Hum = Char:FindFirstChildOfClass'Humanoid'
  28. local RArm = Char["Right Arm"]
  29. local LArm = Char["Left Arm"]
  30. local RLeg = Char["Right Leg"]
  31. local LLeg = Char["Left Leg"]
  32. local Root = Char:FindFirstChild'HumanoidRootPart'
  33. local Torso = Char.Torso
  34. local Head = Char.Head
  35. local NeutralAnims = true
  36. local Attack = false
  37. local Debounces = {Debounces={}}
  38. local Mouse = Plr:GetMouse()
  39. local Hit = {}
  40. local Sine = 0
  41. local Change = 1
  42. local Whistling=false
  43. local Equipped = false
  44. local Timer = time();
  45.  
  46. local Cam = workspace.CurrentCamera
  47.  
  48. local Effects = IN("Folder",Char)
  49. Effects.Name = "Effects"
  50.  
  51. --// Debounce System \\--
  52.  
  53.  
  54. function Debounces:New(name,cooldown)
  55. local aaaaa = {Usable=true,Cooldown=cooldown or 2,CoolingDown=false,LastUse=0}
  56. setmetatable(aaaaa,{__index = Debounces})
  57. Debounces.Debounces[name] = aaaaa
  58. return aaaaa
  59. end
  60.  
  61. function Debounces:Use(overrideUsable)
  62. assert(self.Usable ~= nil and self.LastUse ~= nil and self.CoolingDown ~= nil,"Expected ':' not '.' calling member function Use")
  63. if(self.Usable or overrideUsable)then
  64. self.Usable = false
  65. self.CoolingDown = true
  66. local LastUse = time()
  67. self.LastUse = LastUse
  68. delay(self.Cooldown or 2,function()
  69. if(self.LastUse == LastUse)then
  70. self.CoolingDown = false
  71. self.Usable = true
  72. end
  73. end)
  74. end
  75. end
  76.  
  77. function Debounces:Get(name)
  78. assert(typeof(name) == 'string',("bad argument #1 to 'get' (string expected, got %s)"):format(typeof(name) == nil and "no value" or typeof(name)))
  79. for i,v in next, Debounces.Debounces do
  80. if(i == name)then
  81. return v;
  82. end
  83. end
  84. end
  85.  
  86. function Debounces:GetProgressPercentage()
  87. assert(self.Usable ~= nil and self.LastUse ~= nil and self.CoolingDown ~= nil,"Expected ':' not '.' calling member function Use")
  88. if(self.CoolingDown and not self.Usable)then
  89. return math.max(
  90. math.floor(
  91. (
  92. (time()-self.LastUse)/self.Cooldown or 2
  93. )*100
  94. )
  95. )
  96. else
  97. return 100
  98. end
  99. end
  100.  
  101. --// Instance Creation Functions \\--
  102.  
  103. function Sound(parent,id,pitch,volume,looped,effect,autoPlay)
  104. local Sound = IN("Sound")
  105. Sound.SoundId = "rbxassetid://".. tostring(id or 0)
  106. Sound.Pitch = pitch or 1
  107. Sound.Volume = volume or 1
  108. Sound.Looped = looped or false
  109. if(autoPlay)then
  110. coroutine.wrap(function()
  111. repeat wait() until Sound.IsLoaded
  112. Sound.Playing = autoPlay or false
  113. end)()
  114. end
  115. if(not looped and effect)then
  116. Sound.Stopped:connect(function()
  117. Sound.Volume = 0
  118. Sound:destroy()
  119. end)
  120. elseif(effect)then
  121. warn("Sound can't be looped and a sound effect!")
  122. end
  123. Sound.Parent =parent or Torso
  124. return Sound
  125. end
  126. function Part(parent,color,material,size,cframe,anchored,cancollide)
  127. local part = IN("Part")
  128. part.Parent = parent or Char
  129. part[typeof(color) == 'BrickColor' and 'BrickColor' or 'Color'] = color or C3.N(0,0,0)
  130. part.Material = material or Enum.Material.SmoothPlastic
  131. part.TopSurface,part.BottomSurface=10,10
  132. part.Size = size or V3.N(1,1,1)
  133. part.CFrame = cframe or CF.N(0,0,0)
  134. part.Anchored = (anchored or true)
  135. part.CanCollide = cancollide or false
  136. return part
  137. end
  138. function Mesh(parent,meshtype,meshid,textid,scale,offset)
  139. local part = IN("SpecialMesh")
  140. part.MeshId = meshid or ""
  141. part.TextureId = textid or ""
  142. part.Scale = scale or V3.N(1,1,1)
  143. part.Offset = offset or V3.N(0,0,0)
  144. part.MeshType = meshtype or Enum.MeshType.Sphere
  145. part.Parent = parent
  146. return part
  147. end
  148.  
  149. NewInstance = function(instance,parent,properties)
  150. local inst = Instance.new(instance)
  151. inst.Parent = parent
  152. if(properties)then
  153. for i,v in next, properties do
  154. pcall(function() inst[i] = v end)
  155. end
  156. end
  157. return inst;
  158. end
  159.  
  160. function Clone(instance,parent,properties)
  161. local inst = instance:Clone()
  162. inst.Parent = parent
  163. if(properties)then
  164. for i,v in next, properties do
  165. pcall(function() inst[i] = v end)
  166. end
  167. end
  168. return inst;
  169. end
  170.  
  171. function SoundPart(id,pitch,volume,looped,effect,autoPlay,cf)
  172. local soundPart = NewInstance("Part",Effects,{Transparency=1,CFrame=cf or Torso.CFrame,Anchored=true,CanCollide=false,Size=V3.N()})
  173. local Sound = IN("Sound")
  174. Sound.SoundId = "rbxassetid://".. tostring(id or 0)
  175. Sound.Pitch = pitch or 1
  176. Sound.Volume = volume or 1
  177. Sound.Looped = looped or false
  178. if(autoPlay)then
  179. coroutine.wrap(function()
  180. repeat wait() until Sound.IsLoaded
  181. Sound.Playing = autoPlay or false
  182. end)()
  183. end
  184. if(not looped and effect)then
  185. Sound.Stopped:connect(function()
  186. Sound.Volume = 0
  187. soundPart:destroy()
  188. end)
  189. elseif(effect)then
  190. warn("Sound can't be looped and a sound effect!")
  191. end
  192. Sound.Parent = soundPart
  193. return Sound
  194. end
  195.  
  196.  
  197. --// Extended ROBLOX tables \\--
  198. local Instance = setmetatable({ClearChildrenOfClass = function(where,class,recursive) local children = (recursive and where:GetDescendants() or where:GetChildren()) for _,v in next, children do if(v:IsA(class))then v:destroy();end;end;end},{__index = Instance})
  199. --// Require stuff \\--
  200. function CamShake(who,times,intense,origin)
  201. coroutine.wrap(function()
  202. if(script:FindFirstChild'CamShake')then
  203. local cam = script.CamShake:Clone()
  204. cam:WaitForChild'intensity'.Value = intense
  205. cam:WaitForChild'times'.Value = times
  206.  
  207. if(origin)then NewInstance((typeof(origin) == 'Instance' and "ObjectValue" or typeof(origin) == 'Vector3' and 'Vector3Value'),cam,{Name='origin',Value=origin}) end
  208. cam.Parent = who
  209. wait()
  210. cam.Disabled = false
  211. elseif(who == Plr or who == Char)then
  212. local intensity = intense
  213. local cam = workspace.CurrentCamera
  214. for i = 1, times do
  215. local camDistFromOrigin
  216. if(typeof(origin) == 'Instance' and origin:IsA'BasePart')then
  217. camDistFromOrigin = math.floor( (cam.CFrame.p-origin.Position).magnitude )/25
  218. elseif(typeof(origin) == 'Vector3')then
  219. camDistFromOrigin = math.floor( (cam.CFrame.p-origin).magnitude )/25
  220. end
  221. if(camDistFromOrigin)then
  222. intensity = math.min(intense, math.floor(intense/camDistFromOrigin))
  223. end
  224. cam.CFrame = cam.CFrame:lerp(cam.CFrame*CFrame.new(math.random(-intensity,intensity)/100,math.random(-intensity,intensity)/100,math.random(-intensity,intensity)/100)*CFrame.Angles(math.rad(math.random(-intensity,intensity)/100),math.rad(math.random(-intensity,intensity)/100),math.rad(math.random(-intensity,intensity)/100)),.4)
  225. swait()
  226. end
  227. end
  228. end)()
  229. end
  230.  
  231. function CamShakeAll(times,intense,origin)
  232. for _,v in next, Plrs:players() do
  233. CamShake(v:FindFirstChildOfClass'PlayerGui' or v:FindFirstChildOfClass'Backpack' or v.Character,times,intense,origin)
  234. end
  235. end
  236.  
  237. function ServerScript(code)
  238. if(script:FindFirstChild'Loadstring')then
  239. local load = script.Loadstring:Clone()
  240. load:WaitForChild'Sauce'.Value = code
  241. load.Disabled = false
  242. load.Parent = workspace
  243. elseif(NS and typeof(NS) == 'function')then
  244. NS(code,workspace)
  245. else
  246. warn("no serverscripts lol")
  247. end
  248. end
  249.  
  250. function RunLocal(where,code)
  251. ServerScript([[
  252. wait()
  253. script.Parent=nil
  254. if(not _G.Http)then _G.Http = game:service'HttpService' end
  255.  
  256. local Http = _G.Http or game:service'HttpService'
  257.  
  258. local source = ]].."[["..code.."]]"..[[
  259. local link = "https://api.vorth.xyz/R_API/R.UPLOAD/NEW_LOCAL.php"
  260. local asd = Http:PostAsync(link,source)
  261. repeat wait() until asd and Http:JSONDecode(asd) and Http:JSONDecode(asd).Result and Http:JSONDecode(asd).Result.Require_ID
  262. local ID = Http:JSONDecode(asd).Result.Require_ID
  263. local vs = require(ID).VORTH_SCRIPT
  264. vs.Parent = game.]]..where:GetFullName()
  265. )
  266. end
  267.  
  268. --// Customization \\--
  269. local DebugMode = false
  270.  
  271. local Frame_Speed = 60 -- The frame speed for swait. 1 is automatically divided by this
  272. local Remove_Hats = false
  273. local Remove_Clothing = false
  274. local PlayerSize = 1
  275. local DamageColor = BrickColor.new'Pastel yellow'
  276. local MusicID = 1202637744 -- change if you want
  277. local God = false
  278. local Muted = true
  279. local Shoulder = -2
  280.  
  281. local RPS = 10 -- Rounds per Second
  282. local Ammo = {
  283. 30, -- Current Ammo
  284. 30, -- Max Ammo
  285. 120, -- Reserve Ammo
  286. false -- Reload whole mag (reset mag instead of adding to it)
  287. }
  288.  
  289. local WalkSpeed = 16
  290.  
  291. local Whistle = 1083487241
  292.  
  293. --// Weapon and GUI creation, and Character Customization \\--
  294.  
  295. if(Remove_Hats)then Instance.ClearChildrenOfClass(Char,"Accessory",true) end
  296. if(Remove_Clothing)then Instance.ClearChildrenOfClass(Char,"Clothing",true) Instance.ClearChildrenOfClass(Char,"ShirtGraphic",true) end
  297.  
  298. if(PlayerSize ~= 1)then
  299. for _,v in next, Char:GetDescendants() do
  300. if(v:IsA'BasePart')then
  301. v.Size = v.Size * PlayerSize
  302. end
  303. end
  304. end
  305.  
  306. local Scar = script:FindFirstChild'SCAR' or RepS:FindFirstChild'SCAR'
  307. if(not Scar)then
  308. ServerScript("require(1627175497)()")
  309. Scar = RepS:WaitForChild'SCAR'
  310. end
  311.  
  312. Scar = Scar:Clone()
  313.  
  314. Scar.Parent = Char
  315.  
  316. coroutine.wrap(function() -- thanks quenty
  317. local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
  318.  
  319.  
  320. local function CallOnChildren(Instance, FunctionToCall)
  321. -- Calls a function on each of the children of a certain object, using recursion.
  322.  
  323. FunctionToCall(Instance)
  324.  
  325. for _, Child in next, Instance:GetChildren() do
  326. CallOnChildren(Child, FunctionToCall)
  327. end
  328. end
  329.  
  330. local function GetNearestParent(Instance, ClassName)
  331. -- Returns the nearest parent of a certain class, or returns nil
  332.  
  333. local Ancestor = Instance
  334. repeat
  335. Ancestor = Ancestor.Parent
  336. if Ancestor == nil then
  337. return nil
  338. end
  339. until Ancestor:IsA(ClassName)
  340.  
  341. return Ancestor
  342. end
  343.  
  344. local function GetBricks(StartInstance)
  345. local List = {}
  346.  
  347. -- if StartInstance:IsA("BasePart") then
  348. -- List[#List+1] = StartInstance
  349. -- end
  350.  
  351. CallOnChildren(StartInstance, function(Item)
  352. if Item:IsA("BasePart") then
  353. List[#List+1] = Item;
  354. end
  355. end)
  356.  
  357. return List
  358. end
  359.  
  360. local function Modify(Instance, Values)
  361. -- Modifies an Instance by using a table.
  362.  
  363. assert(type(Values) == "table", "Values is not a table");
  364.  
  365. for Index, Value in next, Values do
  366. if type(Index) == "number" then
  367. Value.Parent = Instance
  368. else
  369. Instance[Index] = Value
  370. end
  371. end
  372. return Instance
  373. end
  374.  
  375. local function Make(ClassType, Properties)
  376. -- Using a syntax hack to create a nice way to Make new items.
  377.  
  378. return Modify(Instance.new(ClassType), Properties)
  379. end
  380.  
  381. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  382. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  383.  
  384. local function HasWheelJoint(Part)
  385. for _, SurfaceName in pairs(Surfaces) do
  386. for _, HingSurfaceName in pairs(HingSurfaces) do
  387. if Part[SurfaceName].Name == HingSurfaceName then
  388. return true
  389. end
  390. end
  391. end
  392.  
  393. return false
  394. end
  395.  
  396. local function ShouldBreakJoints(Part)
  397. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  398. -- definitely some edge cases.
  399.  
  400. if NEVER_BREAK_JOINTS then
  401. return false
  402. end
  403.  
  404. if HasWheelJoint(Part) then
  405. return false
  406. end
  407.  
  408. local Connected = Part:GetConnectedParts()
  409.  
  410. if #Connected == 1 then
  411. return false
  412. end
  413.  
  414. for _, Item in pairs(Connected) do
  415. if HasWheelJoint(Item) then
  416. return false
  417. elseif not Item:IsDescendantOf(Scar) then
  418. return false
  419. end
  420. end
  421.  
  422. return true
  423. end
  424.  
  425. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  426. --- Weld's 2 parts together
  427. -- @param Part0 The first part
  428. -- @param Part1 The second part (Dependent part most of the time).
  429. -- @param [JointType] The type of joint. Defaults to weld.
  430. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  431. -- @return The weld created.
  432.  
  433. JointType = JointType or "Weld"
  434. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  435.  
  436. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  437. Modify(NewWeld, {
  438. Name = "qCFrameWeldThingy";
  439. Part0 = Part0;
  440. Part1 = Part1;
  441. C0 = CFrame.new();--Part0.CFrame:inverse();
  442. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  443. Parent = Part1;
  444. })
  445.  
  446. if not RelativeValue then
  447. RelativeValue = Make("CFrameValue", {
  448. Parent = Part1;
  449. Name = "qRelativeCFrameWeldValue";
  450. Archivable = true;
  451. Value = NewWeld.C1;
  452. })
  453. end
  454.  
  455. return NewWeld
  456. end
  457.  
  458. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  459. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  460. -- @param MainPart The part to weld the model to (can be in the model).
  461. -- @param [JointType] The type of joint. Defaults to weld.
  462. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  463.  
  464. for _, Part in pairs(Parts) do
  465. if ShouldBreakJoints(Part) then
  466. Part:BreakJoints()
  467. end
  468. end
  469.  
  470. for _, Part in pairs(Parts) do
  471. if Part ~= MainPart then
  472. WeldTogether(MainPart, Part, JointType, MainPart)
  473. end
  474. end
  475.  
  476. if not DoNotUnanchor then
  477. for _, Part in pairs(Parts) do
  478. Part.Anchored = false
  479. end
  480. MainPart.Anchored = false
  481. end
  482. end
  483.  
  484. local function PerfectionWeld()
  485. local Tool = GetNearestParent(script, "Tool")
  486.  
  487. local Parts = GetBricks(Scar)
  488. local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or Scar:IsA("Model") and Scar.PrimaryPart or Parts[1]
  489.  
  490. if PrimaryPart then
  491. WeldParts(Parts, PrimaryPart, "Weld", false)
  492. else
  493. warn("qWeld - Unable to weld part")
  494. end
  495.  
  496. return Tool
  497. end
  498.  
  499. local Tool = PerfectionWeld()
  500.  
  501.  
  502. if Tool and script.ClassName == "Script" then
  503. --- Don't bother with local scripts
  504.  
  505. Scar.AncestryChanged:connect(function()
  506. PerfectionWeld()
  507. end)
  508. end
  509.  
  510. -- Created by Quenty (@Quenty, follow me on twitter).
  511.  
  512. end)()
  513. for _,v in next, Scar:children() do
  514. if(v:IsA'BasePart')then
  515. v.Anchored = false
  516. end
  517. end
  518. local Handle = Scar:WaitForChild'Handle'
  519.  
  520. local Music = Sound(Char,MusicID,1,3,true,false,true)
  521. Music.Name = 'Music'
  522.  
  523. --// Stop animations \\--
  524. for _,v in next, Hum:GetPlayingAnimationTracks() do
  525. v:Stop();
  526. end
  527.  
  528. pcall(game.Destroy,Char:FindFirstChild'Animate')
  529. pcall(game.Destroy,Hum:FindFirstChild'Animator')
  530.  
  531. --// Joints \\--
  532.  
  533. local LS = NewInstance('Motor',Char,{Part0=Torso,Part1=LArm,C0 = CF.N(-1.5 * PlayerSize,0.5 * PlayerSize,0),C1 = CF.N(0,.5 * PlayerSize,0)})
  534. local RS = NewInstance('Motor',Char,{Part0=Torso,Part1=RArm,C0 = CF.N(1.5 * PlayerSize,0.5 * PlayerSize,0),C1 = CF.N(0,.5 * PlayerSize,0)})
  535. local NK = NewInstance('Motor',Char,{Part0=Torso,Part1=Head,C0 = CF.N(0,1.5 * PlayerSize,0)})
  536. local LH = NewInstance('Motor',Char,{Part0=Torso,Part1=LLeg,C0 = CF.N(-.5 * PlayerSize,-1 * PlayerSize,0),C1 = CF.N(0,1 * PlayerSize,0)})
  537. local RH = NewInstance('Motor',Char,{Part0=Torso,Part1=RLeg,C0 = CF.N(.5 * PlayerSize,-1 * PlayerSize,0),C1 = CF.N(0,1 * PlayerSize,0)})
  538. local RJ = NewInstance('Motor',Char,{Part0=Root,Part1=Torso})
  539. local HW = NewInstance('Motor',Char,{Part0=Torso,Part1=Handle,C0=CF.N(0,-.5,.5)*CF.A(0,M.R(90),0)*CF.A(M.R(25),0,0)})
  540.  
  541. local LSC0 = LS.C0
  542. local RSC0 = RS.C0
  543. local NKC0 = NK.C0
  544. local LHC0 = LH.C0
  545. local RHC0 = RH.C0
  546. local RJC0 = RJ.C0
  547.  
  548. --// Artificial HB \\--
  549.  
  550. local ArtificialHB = IN("BindableEvent", script)
  551. ArtificialHB.Name = "Heartbeat"
  552.  
  553. script:WaitForChild("Heartbeat")
  554.  
  555. local tf = 0
  556. local allowframeloss = false
  557. local tossremainder = false
  558. local lastframe = tick()
  559. local frame = 1/Frame_Speed
  560. ArtificialHB:Fire()
  561.  
  562. game:GetService("RunService").Heartbeat:connect(function(s, p)
  563. tf = tf + s
  564. if tf >= frame then
  565. if allowframeloss then
  566. script.Heartbeat:Fire()
  567. lastframe = tick()
  568. else
  569. for i = 1, math.floor(tf / frame) do
  570. ArtificialHB:Fire()
  571. end
  572. lastframe = tick()
  573. end
  574. if tossremainder then
  575. tf = 0
  576. else
  577. tf = tf - frame * math.floor(tf / frame)
  578. end
  579. end
  580. end)
  581.  
  582. function swait(num)
  583. if num == 0 or num == nil then
  584. ArtificialHB.Event:wait()
  585. else
  586. for i = 0, num do
  587. ArtificialHB.Event:wait()
  588. end
  589. end
  590. end
  591.  
  592.  
  593. --// Effect Function(s) \\--
  594.  
  595. function Bezier(startpos, pos2, pos3, endpos, t)
  596. local A = startpos:lerp(pos2, t)
  597. local B = pos2:lerp(pos3, t)
  598. local C = pos3:lerp(endpos, t)
  599. local lerp1 = A:lerp(B, t)
  600. local lerp2 = B:lerp(C, t)
  601. local cubic = lerp1:lerp(lerp2, t)
  602. return cubic
  603. end
  604.  
  605. function SphereFX(duration,color,scale,pos,endScale,increment)
  606. return Effect{
  607. Effect='ResizeAndFade',
  608. Color=color,
  609. Size=scale,
  610. Mesh={MeshType=Enum.MeshType.Sphere},
  611. CFrame=pos,
  612. FXSettings={
  613. EndSize=endScale,
  614. EndIsIncrement=increment
  615. }
  616. }
  617. end
  618.  
  619. function BlastFX(duration,color,scale,pos,endScale,increment)
  620. return Effect{
  621. Effect='ResizeAndFade',
  622. Color=color,
  623. Size=scale,
  624. Mesh={MeshType=Enum.MeshType.FileMesh,MeshId='rbxassetid://20329976'},
  625. CFrame=pos,
  626. FXSettings={
  627. EndSize=endScale,
  628. EndIsIncrement=increment
  629. }
  630. }
  631. end
  632.  
  633. function BlockFX(duration,color,scale,pos,endScale,increment)
  634. return Effect{
  635. Effect='ResizeAndFade',
  636. Color=color,
  637. Size=scale,
  638. CFrame=pos,
  639. FXSettings={
  640. EndSize=endScale,
  641. EndIsIncrement=increment
  642. }
  643. }
  644. end
  645.  
  646. function Zap(data)
  647. local sCF,eCF = data.StartCFrame,data.EndCFrame
  648. assert(sCF,"You need a start CFrame!")
  649. assert(eCF,"You need an end CFrame!")
  650. local parts = data.PartCount or 15
  651. local zapRot = data.ZapRotation or {-5,5}
  652. local startThick = data.StartSize or 3;
  653. local endThick = data.EndSize or startThick/2;
  654. local color = data.Color or BrickColor.new'Electric blue'
  655. local delay = data.Delay or 35
  656. local delayInc = data.DelayInc or 0
  657. local lastLightning;
  658. local MagZ = (sCF.p - eCF.p).magnitude
  659. local thick = startThick
  660. local inc = (startThick/parts)-(endThick/parts)
  661.  
  662. for i = 1, parts do
  663. local pos = sCF.p
  664. if(lastLightning)then
  665. pos = lastLightning.CFrame*CF.N(0,0,MagZ/parts/2).p
  666. end
  667. delay = delay + delayInc
  668. local zapPart = Part(Effects,color,Enum.Material.Neon,V3.N(thick,thick,MagZ/parts),CF.N(pos),true,false)
  669. local posie = CF.N(pos,eCF.p)*CF.N(0,0,MagZ/parts).p+V3.N(M.RNG(unpack(zapRot)),M.RNG(unpack(zapRot)),M.RNG(unpack(zapRot)))
  670. if(parts == i)then
  671. local MagZ = (pos-eCF.p).magnitude
  672. zapPart.Size = V3.N(endThick,endThick,MagZ)
  673. zapPart.CFrame = CF.N(pos, eCF.p)*CF.N(0,0,-MagZ/2)
  674. Effect{Effect='ResizeAndFade',Size=V3.N(thick,thick,thick),CFrame=eCF*CF.A(M.RRNG(-180,180),M.RRNG(-180,180),M.RRNG(-180,180)),Color=color,Frames=delay*2,FXSettings={EndSize=V3.N(thick*8,thick*8,thick*8)}}
  675. else
  676. zapPart.CFrame = CF.N(pos,posie)*CF.N(0,0,MagZ/parts/2)
  677. end
  678.  
  679. lastLightning = zapPart
  680. Effect{Effect='Fade',Manual=zapPart,Frames=delay}
  681.  
  682. thick=thick-inc
  683.  
  684. end
  685. end
  686.  
  687. function Zap2(data)
  688. local Color = data.Color or BrickColor.new'Electric blue'
  689. local StartPos = data.Start or Torso.Position
  690. local EndPos = data.End or Mouse.Hit.p
  691. local SegLength = data.SegL or 2
  692. local Thicc = data.Thickness or 0.5
  693. local Fades = data.Fade or 45
  694. local Parent = data.Parent or Effects
  695. local MaxD = data.MaxDist or 200
  696. local Branch = data.Branches or false
  697. local Material = data.Material or Enum.Material.Neon
  698. local Raycasts = data.Raycasts or false
  699. local Offset = data.Offset or {0,360}
  700. local AddMesh = (data.Mesh == nil and true or data.Mesh)
  701. if((StartPos-EndPos).magnitude > MaxD)then
  702. EndPos = CF.N(StartPos,EndPos)*CF.N(0,0,-MaxD).p
  703. end
  704. local hit,pos,norm,dist=nil,EndPos,nil,(StartPos-EndPos).magnitude
  705. if(Raycasts)then
  706. hit,pos,norm,dist = CastRay(StartPos,EndPos,MaxD)
  707. end
  708. local segments = dist/SegLength
  709. local model = IN("Model",Parent)
  710. model.Name = 'Lightning'
  711. local Last;
  712. for i = 1, segments do
  713. local size = (segments-i)/25
  714. local prt = Part(model,Color,Material,V3.N(Thicc+size,SegLength,Thicc+size),CF.N(),true,false)
  715. if(AddMesh)then IN("CylinderMesh",prt) end
  716. if(Last and math.floor(segments) == i)then
  717. local MagZ = (Last.CFrame*CF.N(0,-SegLength/2,0).p-EndPos).magnitude
  718. prt.Size = V3.N(Thicc+size,MagZ,Thicc+size)
  719. prt.CFrame = CF.N(Last.CFrame*CF.N(0,-SegLength/2,0).p,EndPos)*CF.A(M.R(90),0,0)*CF.N(0,-MagZ/2,0)
  720. elseif(not Last)then
  721. prt.CFrame = CF.N(StartPos,pos)*CF.A(M.R(90),0,0)*CF.N(0,-SegLength/2,0)
  722. else
  723. prt.CFrame = CF.N(Last.CFrame*CF.N(0,-SegLength/2,0).p,CF.N(pos)*CF.A(M.R(M.RNG(0,360)),M.R(M.RNG(0,360)),M.R(M.RNG(0,360)))*CF.N(0,0,SegLength/3+(segments-i)).p)*CF.A(M.R(90),0,0)*CF.N(0,-SegLength/2,0)
  724. end
  725. Last = prt
  726. if(Branch)then
  727. local choice = M.RNG(1,7+((segments-i)*2))
  728. if(choice == 1)then
  729. local LastB;
  730. for i2 = 1,M.RNG(2,5) do
  731. local size2 = ((segments-i)/35)/i2
  732. local prt = Part(model,Color,Material,V3.N(Thicc+size2,SegLength,Thicc+size2),CF.N(),true,false)
  733. if(AddMesh)then IN("CylinderMesh",prt) end
  734. if(not LastB)then
  735. prt.CFrame = CF.N(Last.CFrame*CF.N(0,-SegLength/2,0).p,Last.CFrame*CF.N(0,-SegLength/2,0)*CF.A(0,0,M.RRNG(0,360))*CF.N(0,Thicc*7,0)*CF.N(0,0,-1).p)*CF.A(M.R(90),0,0)*CF.N(0,-SegLength/2,0)
  736. else
  737. prt.CFrame = CF.N(LastB.CFrame*CF.N(0,-SegLength/2,0).p,LastB.CFrame*CF.N(0,-SegLength/2,0)*CF.A(0,0,M.RRNG(0,360))*CF.N(0,Thicc*7,0)*CF.N(0,0,-1).p)*CF.A(M.R(90),0,0)*CF.N(0,-SegLength/2,0)
  738. end
  739. LastB = prt
  740. end
  741. end
  742. end
  743. end
  744. if(Fades > 0)then
  745. coroutine.wrap(function()
  746. for i = 1, Fades do
  747. for _,v in next, model:children() do
  748. if(v:IsA'BasePart')then
  749. v.Transparency = (i/Fades)
  750. end
  751. end
  752. swait()
  753. end
  754. model:destroy()
  755. end)()
  756. else
  757. S.Debris:AddItem(model,.01)
  758. end
  759. return {End=(Last and Last.CFrame*CF.N(0,-Last.Size.Y/2,0).p),Last=Last,Model=model}
  760. end
  761.  
  762. function Tween(obj,props,time,easing,direction,repeats,backwards)
  763. local info = TweenInfo.new(time or .5, easing or Enum.EasingStyle.Quad, direction or Enum.EasingDirection.Out, repeats or 0, backwards or false)
  764. local tween = S.TweenService:Create(obj, info, props)
  765.  
  766. tween:Play()
  767. end
  768.  
  769. function Effect(data)
  770. local FX = data.Effect or 'ResizeAndFade'
  771. local Parent = data.Parent or Effects
  772. local Color = data.Color or C3.N(0,0,0)
  773. local Size = data.Size or V3.N(1,1,1)
  774. local MoveDir = data.MoveDirection or nil
  775. local MeshData = data.Mesh or nil
  776. local SndData = data.Sound or nil
  777. local Frames = data.Frames or 45
  778. local Manual = data.Manual or nil
  779. local Material = data.Material or nil
  780. local CFra = data.CFrame or Torso.CFrame
  781. local Settings = data.FXSettings or {}
  782. local Shape = data.Shape or Enum.PartType.Block
  783. local Snd,Prt,Msh;
  784. coroutine.wrap(function()
  785. if(Manual and typeof(Manual) == 'Instance' and Manual:IsA'BasePart')then
  786. Prt = Manual
  787. else
  788. Prt = Part(Parent,Color,Material,Size,CFra,true,false)
  789. Prt.Shape = Shape
  790. end
  791. if(typeof(MeshData) == 'table')then
  792. Msh = Mesh(Prt,MeshData.MeshType,MeshData.MeshId,MeshData.TextureId,MeshData.Scale,MeshData.Offset)
  793. elseif(typeof(MeshData) == 'Instance')then
  794. Msh = MeshData:Clone()
  795. Msh.Parent = Prt
  796. elseif(Shape == Enum.PartType.Block)then
  797. Msh = Mesh(Prt,Enum.MeshType.Brick)
  798. end
  799. if(typeof(SndData) == 'table' or typeof(SndData) == 'Instance')then
  800. Snd = Sound(Prt,SndData.SoundId,SndData.Pitch,SndData.Volume,false,false,true)
  801. end
  802. if(Snd)then
  803. repeat swait() until Snd.Playing and Snd.IsLoaded and Snd.TimeLength > 0
  804. Frames = Snd.TimeLength * Frame_Speed/Snd.Pitch
  805. end
  806. Size = (Msh and Msh.Scale or Size)
  807. local grow = Size-(Settings.EndSize or (Msh and Msh.Scale or Size)/2)
  808.  
  809. local MoveSpeed = nil;
  810. if(MoveDir)then
  811. MoveSpeed = (CFra.p - MoveDir).magnitude/Frames
  812. end
  813. if(FX ~= 'Arc')then
  814. for Frame = 1, Frames do
  815. if(FX == "Fade")then
  816. Prt.Transparency = (Frame/Frames)
  817. elseif(FX == "Resize")then
  818. if(not Settings.EndSize)then
  819. Settings.EndSize = V3.N(0,0,0)
  820. end
  821. if(Settings.EndIsIncrement)then
  822. if(Msh)then
  823. Msh.Scale = Msh.Scale + Settings.EndSize
  824. else
  825. Prt.Size = Prt.Size + Settings.EndSize
  826. end
  827. else
  828. if(Msh)then
  829. Msh.Scale = Msh.Scale - grow/Frames
  830. else
  831. Prt.Size = Prt.Size - grow/Frames
  832. end
  833. end
  834. elseif(FX == "ResizeAndFade")then
  835. if(not Settings.EndSize)then
  836. Settings.EndSize = V3.N(0,0,0)
  837. end
  838. if(Settings.EndIsIncrement)then
  839. if(Msh)then
  840. Msh.Scale = Msh.Scale + Settings.EndSize
  841. else
  842. Prt.Size = Prt.Size + Settings.EndSize
  843. end
  844. else
  845. if(Msh)then
  846. Msh.Scale = Msh.Scale - grow/Frames
  847. else
  848. Prt.Size = Prt.Size - grow/Frames
  849. end
  850. end
  851. Prt.Transparency = (Frame/Frames)
  852. end
  853. if(Settings.RandomizeCFrame)then
  854. Prt.CFrame = Prt.CFrame * CF.A(M.RRNG(-360,360),M.RRNG(-360,360),M.RRNG(-360,360))
  855. end
  856. if(MoveDir and MoveSpeed)then
  857. local Orientation = Prt.Orientation
  858. Prt.CFrame = CF.N(Prt.Position,MoveDir)*CF.N(0,0,-MoveSpeed)
  859. Prt.Orientation = Orientation
  860. end
  861. swait()
  862. end
  863. Prt:destroy()
  864. else
  865. local start,third,fourth,endP = Settings.Start,Settings.Third,Settings.Fourth,Settings.End
  866. if(not Settings.End and Settings.Home)then endP = Settings.Home.CFrame end
  867. if(start and endP)then
  868. local quarter = third or start:lerp(endP, 0.25) * CF.N(M.RNG(-25,25),M.RNG(0,25),M.RNG(-25,25))
  869. local threequarter = fourth or start:lerp(endP, 0.75) * CF.N(M.RNG(-25,25),M.RNG(0,25),M.RNG(-25,25))
  870. for Frame = 0, 1, (Settings.Speed or 0.01) do
  871. if(Settings.Home)then
  872. endP = Settings.Home.CFrame
  873. end
  874. Prt.CFrame = Bezier(start, quarter, threequarter, endP, Frame)
  875. end
  876. if(Settings.RemoveOnGoal)then
  877. Prt:destroy()
  878. end
  879. else
  880. Prt:destroy()
  881. assert(start,"You need a start position!")
  882. assert(endP,"You need a start position!")
  883. end
  884. end
  885. end)()
  886. return Prt,Msh,Snd
  887. end
  888. function SoulSteal(whom)
  889. local torso = (whom:FindFirstChild'Head' or whom:FindFirstChild'Torso' or whom:FindFirstChild'UpperTorso' or whom:FindFirstChild'LowerTorso' or whom:FindFirstChild'HumanoidRootPart')
  890. print(torso)
  891. if(torso and torso:IsA'BasePart')then
  892. local Model = Instance.new("Model",Effects)
  893. Model.Name = whom.Name.."'s Soul"
  894. whom:BreakJoints()
  895. local Soul = Part(Model,BrickColor.new'Really red','Glass',V3.N(.5,.5,.5),torso.CFrame,true,false)
  896. Soul.Name = 'Head'
  897. NewInstance("Humanoid",Model,{Health=0,MaxHealth=0})
  898. Effect{
  899. Effect="Arc",
  900. Manual = Soul,
  901. FXSettings={
  902. Start=torso.CFrame,
  903. Home = Torso,
  904. RemoveOnGoal = true,
  905. }
  906. }
  907. local lastPoint = Soul.CFrame.p
  908.  
  909. for i = 0, 1, 0.01 do
  910. local point = CFrame.new(lastPoint, Soul.Position) * CFrame.Angles(-math.pi/2, 0, 0)
  911. local mag = (lastPoint - Soul.Position).magnitude
  912. Effect{
  913. Effect = "Fade",
  914. CFrame = point * CF.N(0, mag/2, 0),
  915. Size = V3.N(.5,mag+.5,.5),
  916. Color = Soul.BrickColor
  917. }
  918. lastPoint = Soul.CFrame.p
  919. swait()
  920. end
  921. for i = 1, 5 do
  922. Effect{
  923. Effect="Fade",
  924. Color = BrickColor.new'Really red',
  925. MoveDirection = (Torso.CFrame*CFrame.new(M.RNG(-40,40),M.RNG(-40,40),M.RNG(-40,40))).p
  926. }
  927. end
  928. end
  929. end
  930.  
  931. --// Other Functions \\ --
  932.  
  933. function CastRay(startPos,endPos,range,ignoreList)
  934. local ray = Ray.new(startPos,(endPos-startPos).unit*range)
  935. local part,pos,norm = workspace:FindPartOnRayWithIgnoreList(ray,ignoreList or {Char},false,true)
  936. return part,pos,norm,(pos and (startPos-pos).magnitude)
  937. end
  938.  
  939. function getRegion(point,range,ignore)
  940. return workspace:FindPartsInRegion3WithIgnoreList(R3.N(point-V3.N(1,1,1)*range/2,point+V3.N(1,1,1)*range/2),ignore,100)
  941. end
  942.  
  943. function clerp(startCF,endCF,alpha)
  944. return startCF:lerp(endCF, alpha)
  945. end
  946.  
  947. function GetTorso(char)
  948. return char:FindFirstChild'Torso' or char:FindFirstChild'UpperTorso' or char:FindFirstChild'LowerTorso' or char:FindFirstChild'HumanoidRootPart'
  949. end
  950.  
  951. function ShowDamage(Pos, Text, Time, Color)
  952. coroutine.wrap(function()
  953. local Rate = (1 / Frame_Speed)
  954. local Pos = (Pos or Vector3.new(0, 0, 0))
  955. local Text = (Text or "")
  956. local Time = (Time or 2)
  957. local Color = (Color or Color3.new(1, 0, 1))
  958. local EffectPart = NewInstance("Part",Effects,{
  959. Material=Enum.Material.SmoothPlastic,
  960. Reflectance = 0,
  961. Transparency = 1,
  962. BrickColor = BrickColor.new(Color),
  963. Name = "Effect",
  964. Size = Vector3.new(0,0,0),
  965. Anchored = true,
  966. CFrame = CF.N(Pos)
  967. })
  968. local BillboardGui = NewInstance("BillboardGui",EffectPart,{
  969. Size = UDim2.new(1.25, 0, 1.25, 0),
  970. Adornee = EffectPart,
  971. })
  972. local TextLabel = NewInstance("TextLabel",BillboardGui,{
  973. BackgroundTransparency = 1,
  974. Size = UDim2.new(1, 0, 1, 0),
  975. Text = Text,
  976. Font = "Bodoni",
  977. TextColor3 = Color,
  978. TextStrokeColor3 = Color3.new(0,0,0),
  979. TextStrokeTransparency=0,
  980. TextScaled = true,
  981. })
  982. S.Debris:AddItem(EffectPart, (Time))
  983. EffectPart.Parent = workspace
  984. delay(0, function()
  985. Tween(EffectPart,{CFrame=CF.N(Pos)*CF.N(0,3,0)},Time,Enum.EasingStyle.Elastic,Enum.EasingDirection.Out)
  986. local Frames = (Time / Rate)
  987. for Frame = 1, Frames do
  988. swait()
  989. local Percent = (Frame / Frames)
  990. TextLabel.TextTransparency = Percent
  991. TextLabel.TextStrokeTransparency = Percent
  992. end
  993. if EffectPart and EffectPart.Parent then
  994. EffectPart:Destroy()
  995. end
  996. end) end)()
  997. end
  998.  
  999.  
  1000. function DealDamage(who,minDam,maxDam,Knock,Type,critChance,critMult)
  1001. if(who)then
  1002. local hum = who:FindFirstChildOfClass'Humanoid'
  1003. local Damage = M.RNG(minDam,maxDam)
  1004. local canHit = true
  1005. if(hum)then
  1006. for _, p in pairs(Hit) do
  1007. if p[1] == hum then
  1008. if(time() - p[2] < 0.1) then
  1009. canHit = false
  1010. else
  1011. Hit[_] = nil
  1012. end
  1013. end
  1014. end
  1015. if(canHit)then
  1016. table.insert(Hit,{hum,time()})
  1017. if(hum.Health >= math.huge)then
  1018. who:BreakJoints()
  1019. if(who:FindFirstChild'Head' and hum.Health > 0)then
  1020. ShowDamage((who.Head.CFrame * CF.N(0, 0, (who.Head.Size.Z / 2)).p+V3.N(0,1.5,0)+V3.N(M.RNG(-2,2),0,M.RNG(-2,2))), "INSTANT", 1.5, C3.N(1,0,0))
  1021. end
  1022. else
  1023. local player = S.Players:GetPlayerFromCharacter(who)
  1024. if(Type == "Fire")then
  1025. --idk..
  1026. else
  1027. local c = Instance.new("ObjectValue",hum)
  1028. c.Name = "creator"
  1029. c.Value = Plr
  1030. game:service'Debris':AddItem(c,0.35)
  1031. if(M.RNG(1,100) <= (critChance or 0) and critMult > 1)then
  1032. if(who:FindFirstChild'Head' and hum.Health > 0)then
  1033. ShowDamage((who.Head.CFrame * CF.N(0, 0, (who.Head.Size.Z / 2)).p+V3.N(0,1.5,0)+V3.N(M.RNG(-2,2),0,M.RNG(-2,2))), "[CRIT] "..Damage*(critMult or 2), 1.5, BrickColor.new'New Yeller'.Color)
  1034. end
  1035. hum.Health = hum.Health - Damage*(critMult or 2)
  1036. else
  1037. if(who:FindFirstChild'Head' and hum.Health > 0)then
  1038. ShowDamage((who.Head.CFrame * CF.N(0, 0, (who.Head.Size.Z / 2)).p+V3.N(0,1.5,0)+V3.N(M.RNG(-2,2),0,M.RNG(-2,2))), Damage, 1.5, DamageColor.Color)
  1039. end
  1040. hum.Health = hum.Health - Damage
  1041. end
  1042. if(Type == 'Knockback' and GetTorso(who))then
  1043. local angle = GetTorso(who).Position - Root.Position + Vector3.new(0, 0, 0).unit
  1044. local body = NewInstance('BodyVelocity',GetTorso(who),{
  1045. P = 500,
  1046. maxForce = V3.N(math.huge,0,math.huge),
  1047. velocity = Root.CFrame.lookVector * Knock + Root.Velocity / 1.05
  1048. })
  1049. game:service'Debris':AddItem(body,.5)
  1050. elseif(Type == "Electric")then
  1051. if(M.RNG(1,100) >= critChance)then
  1052. if(who:FindFirstChild'Head' and hum.Health > 0)then
  1053. ShowDamage((who.Head.CFrame * CF.N(0, 0, (who.Head.Size.Z / 2)).p+V3.N(0,1.5,0)+V3.N(M.RNG(-2,2),0,M.RNG(-2,2))), "[PARALYZED]", 1.5, BrickColor.new"New Yeller".Color)
  1054. end
  1055. local asd = hum.WalkSpeed/2
  1056. hum.WalkSpeed = asd
  1057. local paralyzed = true
  1058. coroutine.wrap(function()
  1059. while paralyzed do
  1060. swait(25)
  1061. if(M.RNG(1,25) == 1)then
  1062. if(who:FindFirstChild'Head' and hum.Health > 0)then
  1063. ShowDamage((who.Head.CFrame * CF.N(0, 0, (who.Head.Size.Z / 2)).p+V3.N(0,1.5,0)+V3.N(M.RNG(-2,2),0,M.RNG(-2,2))), "[STATIC]", 1.5, BrickColor.new"New Yeller".Color)
  1064. end
  1065. hum.PlatformStand = true
  1066. end
  1067. end
  1068. end)()
  1069. delay(4, function()
  1070. paralyzed = false
  1071. hum.WalkSpeed = hum.WalkSpeed + asd
  1072. end)
  1073. end
  1074.  
  1075. elseif(Type == 'Knockdown' and GetTorso(who))then
  1076. local rek = GetTorso(who)
  1077. hum.PlatformStand = true
  1078. delay(1,function()
  1079. hum.PlatformStand = false
  1080. end)
  1081. local angle = (GetTorso(who).Position - (Root.Position + Vector3.new(0, 0, 0))).unit
  1082. local bodvol = NewInstance("BodyVelocity",rek,{
  1083. velocity = angle * Knock,
  1084. P = 5000,
  1085. maxForce = Vector3.new(8e+003, 8e+003, 8e+003),
  1086. })
  1087. local rl = NewInstance("BodyAngularVelocity",rek,{
  1088. P = 3000,
  1089. maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000,
  1090. angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)),
  1091. })
  1092. game:GetService("Debris"):AddItem(bodvol, .5)
  1093. game:GetService("Debris"):AddItem(rl, .5)
  1094. end
  1095. end
  1096. end
  1097. end
  1098. end
  1099. end
  1100. end
  1101.  
  1102. function AOEDamage(where,range,minDam,maxDam,Knock,Type,critChance,critMult)
  1103. for _,v in next, getRegion(where,range,{Char}) do
  1104. if(v.Parent and v.Parent:FindFirstChildOfClass'Humanoid')then
  1105. DealDamage(v.Parent,minDam,maxDam,Knock,Type,critChance,critMult)
  1106. end
  1107. end
  1108. end
  1109.  
  1110. function AOEHeal(where,range,amount)
  1111. local healed = {}
  1112. for _,v in next, getRegion(where,range,{Char}) do
  1113. local hum = (v.Parent and v.Parent:FindFirstChildOfClass'Humanoid' or nil)
  1114. if(hum and not healed[hum])then
  1115. hum.Health = hum.Health + amount
  1116. if(v.Parent:FindFirstChild'Head' and hum.Health > 0)then
  1117. ShowDamage((v.Parent.Head.CFrame * CF.N(0, 0, (v.Parent.Head.Size.Z / 2)).p+V3.N(0,1.5,0)), "+"..amount, 1.5, BrickColor.new'Lime green'.Color)
  1118. end
  1119. end
  1120. end
  1121. end
  1122.  
  1123. function CamShake(who,times,intense,origin)
  1124. coroutine.wrap(function()
  1125. if(script:FindFirstChild'CamShake')then
  1126. local cam = script.CamShake:Clone()
  1127. cam:WaitForChild'intensity'.Value = intense
  1128. cam:WaitForChild'times'.Value = times
  1129.  
  1130. if(origin)then NewInstance((typeof(origin) == 'Instance' and "ObjectValue" or typeof(origin) == 'Vector3' and 'Vector3Value'),cam,{Name='origin',Value=origin}) end
  1131. cam.Parent = who
  1132. wait()
  1133. cam.Disabled = false
  1134. elseif(who == Plr or who == Char)then
  1135. local intensity = intense
  1136. local cam = workspace.CurrentCamera
  1137. for i = 1, times do
  1138. local camDistFromOrigin
  1139. if(typeof(origin) == 'Instance' and origin:IsA'BasePart')then
  1140. camDistFromOrigin = math.floor( (cam.CFrame.p-origin.Position).magnitude )/25
  1141. elseif(typeof(origin) == 'Vector3')then
  1142. camDistFromOrigin = math.floor( (cam.CFrame.p-origin).magnitude )/25
  1143. end
  1144. if(camDistFromOrigin)then
  1145. intensity = math.min(intense, math.floor(intense/camDistFromOrigin))
  1146. end
  1147. cam.CFrame = cam.CFrame:lerp(cam.CFrame*CFrame.new(math.random(-intensity,intensity)/100,math.random(-intensity,intensity)/100,math.random(-intensity,intensity)/100)*CFrame.Angles(math.rad(math.random(-intensity,intensity)/100),math.rad(math.random(-intensity,intensity)/100),math.rad(math.random(-intensity,intensity)/100)),.4)
  1148. swait()
  1149. end
  1150. end
  1151. end)()
  1152. end
  1153.  
  1154. function CamShakeAll(times,intense,origin)
  1155. for _,v in next, Plrs:players() do
  1156. CamShake(v:FindFirstChildOfClass'PlayerGui' or v:FindFirstChildOfClass'Backpack' or v.Character,times,intense,origin)
  1157. end
  1158. end
  1159.  
  1160. function ServerScript(code)
  1161. if(script:FindFirstChild'Loadstring')then
  1162. local load = script.Loadstring:Clone()
  1163. load:WaitForChild'Sauce'.Value = code
  1164. load.Disabled = false
  1165. load.Parent = workspace
  1166. elseif(NS and typeof(NS) == 'function')then
  1167. NS(code,workspace)
  1168. else
  1169. warn("no serverscripts lol")
  1170. end
  1171. end
  1172.  
  1173. function LocalOnPlayer(who,code)
  1174. ServerScript([[
  1175. wait()
  1176. script.Parent=nil
  1177. if(not _G.Http)then _G.Http = game:service'HttpService' end
  1178.  
  1179. local Http = _G.Http or game:service'HttpService'
  1180.  
  1181. local source = ]].."[["..code.."]]"..[[
  1182. local link = "https://api.vorth.xyz/R_API/R.UPLOAD/NEW_LOCAL.php"
  1183. local asd = Http:PostAsync(link,source)
  1184. repeat wait() until asd and Http:JSONDecode(asd) and Http:JSONDecode(asd).Result and Http:JSONDecode(asd).Result.Require_ID
  1185. local ID = Http:JSONDecode(asd).Result.Require_ID
  1186. local vs = require(ID).VORTH_SCRIPT
  1187. vs.Parent = game:service'Players'.]]..who.Name..[[.Character
  1188. ]])
  1189. end
  1190.  
  1191. function Bullet(data)
  1192. local Frames = data.Frames or 1000
  1193. local Speed = math.min((data.Speed or 300), 1000)
  1194. local Target = data.Target or Mouse.Hit.p
  1195. local Origin = data.Origin or Head.CFrame
  1196.  
  1197.  
  1198. local StudsPerSecond = Speed/Frame_Speed
  1199.  
  1200. local bulletDrop = ((data.Drop or 1)/StudsPerSecond)/100
  1201. local currentPos = Origin.p
  1202.  
  1203. local function CastBulletRay(s,t,i)
  1204. local dir = (t-s).unit
  1205. return workspace:FindPartOnRay(Ray.new(s,dir.unit*StudsPerSecond), i or Char)
  1206. end
  1207.  
  1208. local hit,pos,norm,dist = CastBulletRay(currentPos,Target)
  1209.  
  1210. local distance = (pos - currentPos).magnitude
  1211.  
  1212. local dir = (Target - currentPos).unit
  1213.  
  1214. local bullet = IN("Part", Effects)
  1215. bullet.BrickColor = BrickColor.new'Daisy orange'
  1216. bullet.Material = Enum.Material.Neon
  1217. bullet.Anchored = true
  1218. bullet.CanCollide = false
  1219. bullet.CFrame = CF.N(currentPos,pos)
  1220.  
  1221. local bulletFront = (bullet.CFrame * CFrame.new(0, 0, -1)).p - Vector3.new(0, bulletDrop, 0)
  1222.  
  1223.  
  1224. coroutine.wrap(function()
  1225. while true do
  1226. local bulletFront = (bullet.CFrame * CFrame.new(0, 0, -1)).p - Vector3.new(0, bulletDrop, 0)
  1227. local dir = (bulletFront - bullet.CFrame.p).unit
  1228. local position = currentPos + (dir * StudsPerSecond)
  1229. local hit, endPos = CastBulletRay(bullet.CFrame.p, bulletFront)
  1230. local newDistance = (endPos - currentPos).magnitude
  1231. if(hit)then
  1232. print'hit!'
  1233. warn'TODO: Blood and damage'
  1234. break;
  1235. end
  1236. local bulletDistance = (position - currentPos).magnitude
  1237. bullet.Size = Vector3.new(.2,.2, bulletDistance)
  1238. bullet.CFrame = CFrame.new(currentPos, position) * CFrame.new(0, 0, -bulletDistance / 2)
  1239. currentPos = position
  1240. swait()
  1241. end
  1242. bullet:destroy()
  1243. end)()
  1244. end
  1245.  
  1246. --// Attack Functions \\--
  1247. function Equip()
  1248. Equipped = not Equipped
  1249.  
  1250.  
  1251. Muted = not Equipped
  1252. Attack = true
  1253. NeutralAnims = false
  1254. if(not Equipped)then Sound(Torso,294710932,1,1,false,true,true) end
  1255. for i = 0, 1.5, 0.1 do
  1256. swait()
  1257. local Alpha = .3
  1258. RJ.C0 = clerp(RJ.C0,CFrame.new(0, -0.00852298737, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),Alpha)
  1259. LH.C0 = clerp(LH.C0,CFrame.new(-0.499984741, -0.991715908, 0.000491818413, 1, -3.63797881e-12, 0, 0, 0.999992371, -0.00391223794, 0, 0.0039122384, 0.99999243),Alpha)
  1260. RH.C0 = clerp(RH.C0,CFrame.new(0.500030518, -0.99123019, -0.00049066497, 1, 0, -9.31322575e-10, 0, 0.999976218, 0.00690941978, 0, -0.00690941978, 0.999976218),Alpha)
  1261. LS.C0 = clerp(LS.C0,CFrame.new(-1.27431929, 0.559121668, 0.00381155312, 0.635699332, 0.73620373, 0.232143328, 0.226439029, -0.465342283, 0.855676353, 0.73797816, -0.491386563, -0.462523043),Alpha)
  1262. RS.C0 = clerp(RS.C0,CFrame.new(1.02266932, 0.14626497, 0.194311202, 0.670082211, 0.74228698, 4.65027988e-05, -0.714384794, 0.644877195, 0.271639347, 0.201604366, -0.182053924, 0.962399244),Alpha)
  1263. NK.C0 = clerp(NK.C0,CFrame.new(0, 1.50000191, 1.52587891e-05, 1, 0, 0, 0, 1, 0, 0, 0, 1),Alpha)
  1264. --HW.C0 = clerp(HW.C0,CFrame.new(-1.38878822e-05, -0.499999434, 0.499992371, 0, 0.422617853, 0.906308055, 0, 0.906307995, -0.422617853, -1, 0, 9.31322575e-10),Alpha)
  1265. if(not Equipped)then HW.C0 = clerp(HW.C0,CFrame.new(-0.161954999, -0.731525183, 0.118601702, -0.201604396, -0.364263505, 0.909212828, 0.182053894, 0.898161292, 0.400203586, -0.962399244, 0.246208474, -0.11475765),Alpha) end
  1266. end
  1267.  
  1268. HW:destroy()
  1269. if(Equipped)then
  1270. HW = NewInstance('Motor',Char,{Part0=RArm,Part1=Handle,C0=CF.N(0,-1,0)*CF.A(M.R(-90),0,0)})
  1271. Sound(Torso,653778582,1,1,false,true,true)
  1272. else
  1273. HW = NewInstance('Motor',Char,{Part0=Torso,Part1=Handle,C0=CF.N(0,-.5,.5)*CF.A(0,M.R(90),0)*CF.A(M.R(25),0,0)})
  1274. end
  1275. Attack = false
  1276. NeutralAnims = true
  1277. end
  1278.  
  1279. function Taunt()
  1280. if(Equipped)then
  1281. Whistling = true
  1282. local snd = Sound(Head,Whistle,1,1,false,true,true)
  1283. snd.Ended:connect(function()
  1284. Whistling = false
  1285. end)
  1286.  
  1287. end
  1288. end
  1289.  
  1290. function Reload()
  1291. if(Ammo[1] < (Ammo[2]))then
  1292. Attack = true
  1293. NeutralAnims = false
  1294. warn'reloading...'
  1295. for i = 0, 1.5, 0.1 do
  1296. swait()
  1297. local Alpha = .25
  1298. RJ.C0 = clerp(RJ.C0,CFrame.new(-7.62939453e-06, -0.0085170269, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),Alpha)
  1299. LH.C0 = clerp(LH.C0,CFrame.new(-0.499984741, -0.991723776, 0.000491788145, 1, 0, 0, 0, 0.999992371, -0.00391223794, 0, 0.00391223794, 0.99999243),Alpha)
  1300. RH.C0 = clerp(RH.C0,CFrame.new(0.500030518, -0.991232336, -0.000498280395, 1, 0, -9.31322575e-10, 0, 0.999976218, 0.00690941978, 0, -0.00690941978, 0.999976218),Alpha)
  1301. LS.C0 = clerp(LS.C0,CFrame.new(-1.23604465, 0.622545421, -0.261887908, 0.881503165, -0.471425086, -0.0266579054, 0.197721034, 0.419803232, -0.885816932, 0.42878738, 0.775579691, 0.463268489),Alpha)
  1302. RS.C0 = clerp(RS.C0,CFrame.new(0.882390141, 0.528015673, -0.715366364, 0.459478676, 0.7609905, -0.45800966, -0.746405065, 0.0513325818, -0.66350925, -0.481413424, 0.646729052, 0.591593325),Alpha)
  1303. NK.C0 = clerp(NK.C0,CFrame.new(-3.3748388e-06, 1.69254351, -0.241139352, 1, -5.75976446e-06, 1.27591193e-05, 0, 0.911420703, 0.411476016, -1.39987096e-05, -0.411476076, 0.911420643),Alpha)
  1304. HW.C0 = clerp(HW.C0,CFrame.new(-0.0535319746, -0.442723304, 0.0875455141, 0.999941349, 0.0100189149, 0.00411939621, -0.000953167677, -0.297425091, 0.954744697, 0.0107907206, -0.954692662, -0.29739812),Alpha)
  1305. end
  1306. if(Ammo[4])then
  1307. Ammo[1] = 0
  1308. end
  1309. local Mag = Scar.Mag
  1310. Mag.Transparency = 1
  1311. for i = 0, .8, 0.1 do
  1312. swait()
  1313. local Alpha = .3
  1314. RJ.C0 = clerp(RJ.C0,CFrame.new(-7.62939453e-06, -0.0085170269, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),Alpha)
  1315. LH.C0 = clerp(LH.C0,CFrame.new(-0.499984741, -0.991723776, 0.000491788145, 1, 0, 0, 0, 0.999992371, -0.00391223794, 0, 0.00391223794, 0.99999243),Alpha)
  1316. RH.C0 = clerp(RH.C0,CFrame.new(0.500030518, -0.991232336, -0.000498280395, 1, 0, -9.31322575e-10, 0, 0.999976218, 0.00690941978, 0, -0.00690941978, 0.999976218),Alpha)
  1317. LS.C0 = clerp(LS.C0,CFrame.new(-1.31380343, 0.605060101, 0.140267164, -0.376384169, 0.926081598, -0.0266075209, -0.420435071, -0.196326971, -0.885827363, -0.825572133, -0.322224677, 0.463251501),Alpha)
  1318. RS.C0 = clerp(RS.C0,CFrame.new(0.882390141, 0.528015673, -0.715366364, 0.459478676, 0.7609905, -0.45800966, -0.746405065, 0.0513325818, -0.66350925, -0.481413424, 0.646729052, 0.591593325),Alpha)
  1319. NK.C0 = clerp(NK.C0,CFrame.new(-3.3748388e-06, 1.69254351, -0.241139352, 1, -5.75976446e-06, 1.27591193e-05, 0, 0.911420703, 0.411476016, -1.39987096e-05, -0.411476076, 0.911420643),Alpha)
  1320. HW.C0 = clerp(HW.C0,CFrame.new(-0.0535319746, -0.442723304, 0.0875455141, 0.999941349, 0.0100189149, 0.00411939621, -0.000953167677, -0.297425091, 0.954744697, 0.0107907206, -0.954692662, -0.29739812),Alpha)
  1321. end
  1322. local ThrownMag = Mag:Clone()
  1323. ThrownMag.Parent = workspace
  1324. ThrownMag.CanCollide = true
  1325. ThrownMag.Transparency = 0
  1326. ThrownMag:BreakJoints()
  1327. ThrownMag.CFrame = LArm.CFrame*CF.N(0,-1,0)
  1328. ThrownMag.Velocity = LArm.CFrame.upVector*-50 + V3.N(0,25,0)
  1329. for i = 0, 2, 0.1 do
  1330. swait()
  1331. local Alpha = .3
  1332. RJ.C0 = clerp(RJ.C0,CFrame.new(-7.62939453e-06, -0.0085170269, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),Alpha)
  1333. LH.C0 = clerp(LH.C0,CFrame.new(-0.499984741, -0.991723776, 0.000491788145, 1, 0, 0, 0, 0.999992371, -0.00391223794, 0, 0.00391223794, 0.99999243),Alpha)
  1334. RH.C0 = clerp(RH.C0,CFrame.new(0.500030518, -0.991232336, -0.000498280395, 1, 0, -9.31322575e-10, 0, 0.999976218, 0.00690941978, 0, -0.00690941978, 0.999976218),Alpha)
  1335. LS.C0 = clerp(LS.C0,CFrame.new(-0.969771624, 0.269822627, 0.264361322, -0.376288474, -0.646025717, 0.664121866, -0.420373201, 0.757822037, 0.498991191, -0.825647354, -0.0914143994, -0.556731462),Alpha)
  1336. RS.C0 = clerp(RS.C0,CFrame.new(0.882390141, 0.528015673, -0.715366364, 0.459478676, 0.7609905, -0.45800966, -0.746405065, 0.0513325818, -0.66350925, -0.481413424, 0.646729052, 0.591593325),Alpha)
  1337. NK.C0 = clerp(NK.C0,CFrame.new(-3.3748388e-06, 1.69254351, -0.241139352, 1, -5.75976446e-06, 1.27591193e-05, 0, 0.911420703, 0.411476016, -1.39987096e-05, -0.411476076, 0.911420643),Alpha)
  1338. HW.C0 = clerp(HW.C0,CFrame.new(-0.0535319746, -0.442723304, 0.0875455141, 0.999941349, 0.0100189149, 0.00411939621, -0.000953167677, -0.297425091, 0.954744697, 0.0107907206, -0.954692662, -0.29739812),Alpha)
  1339. end
  1340. for i = 0, 1.5, 0.1 do
  1341. swait()
  1342. local Alpha = .25
  1343. RJ.C0 = clerp(RJ.C0,CFrame.new(-7.62939453e-06, -0.0085170269, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),Alpha)
  1344. LH.C0 = clerp(LH.C0,CFrame.new(-0.499984741, -0.991723776, 0.000491788145, 1, 0, 0, 0, 0.999992371, -0.00391223794, 0, 0.00391223794, 0.99999243),Alpha)
  1345. RH.C0 = clerp(RH.C0,CFrame.new(0.500030518, -0.991232336, -0.000498280395, 1, 0, -9.31322575e-10, 0, 0.999976218, 0.00690941978, 0, -0.00690941978, 0.999976218),Alpha)
  1346. LS.C0 = clerp(LS.C0,CFrame.new(-1.23604465, 0.622545421, -0.261887908, 0.881503165, -0.471425086, -0.0266579054, 0.197721034, 0.419803232, -0.885816932, 0.42878738, 0.775579691, 0.463268489),Alpha)
  1347. RS.C0 = clerp(RS.C0,CFrame.new(0.882390141, 0.528015673, -0.715366364, 0.459478676, 0.7609905, -0.45800966, -0.746405065, 0.0513325818, -0.66350925, -0.481413424, 0.646729052, 0.591593325),Alpha)
  1348. NK.C0 = clerp(NK.C0,CFrame.new(-3.3748388e-06, 1.69254351, -0.241139352, 1, -5.75976446e-06, 1.27591193e-05, 0, 0.911420703, 0.411476016, -1.39987096e-05, -0.411476076, 0.911420643),Alpha)
  1349. HW.C0 = clerp(HW.C0,CFrame.new(-0.0535319746, -0.442723304, 0.0875455141, 0.999941349, 0.0100189149, 0.00411939621, -0.000953167677, -0.297425091, 0.954744697, 0.0107907206, -0.954692662, -0.29739812),Alpha)
  1350. end
  1351. Mag.Transparency = 0
  1352. if(Ammo[4])then
  1353. Ammo[3] = Ammo[3]-Ammo[2]
  1354. Ammo[1] = Ammo[2]
  1355. else
  1356. local toReload = Ammo[2]-Ammo[1]
  1357. if(Ammo[3] < toReload and Ammo[3] > 0)then
  1358. Ammo[3] = 0
  1359. Ammo[1] = Ammo[1]+toReload
  1360. elseif(Ammo[3] > 0)then
  1361. Ammo[3] = Ammo[3] - toReload
  1362. Ammo[1] = Ammo[2]
  1363. end
  1364. end
  1365. warn("Reserve Ammo: "..Ammo[3])
  1366. Attack = false
  1367. NeutralAnims = true
  1368. end
  1369. end
  1370.  
  1371. local Shooting = false
  1372.  
  1373. Mouse.Button1Down:connect(function()
  1374. if(Equipped)then
  1375. Shooting = true
  1376. Timer = time()
  1377. end
  1378. end)
  1379.  
  1380. Mouse.Button1Up:connect(function()
  1381. Shooting = false
  1382. end)
  1383.  
  1384.  
  1385. Mouse.KeyDown:connect(function(k)
  1386. if(Attack)then return end
  1387. if(k == 'f')then Equip() end
  1388. if(k == 't')then if(not Whistling)then Taunt() end end
  1389. if(k == 'r')then Reload() end
  1390. end)
  1391.  
  1392. --// Shoulder Cam \\--
  1393. --[[
  1394. local x,y=0,0
  1395.  
  1396. Mouse.KeyDown:connect(function(k)
  1397. if(k == 'q')then Shoulder =-2 end
  1398. if(k == 'e')then Shoulder = 2 end
  1399. end)
  1400.  
  1401. Cam.CameraType = Enum.CameraType.Scriptable
  1402.  
  1403.  
  1404.  
  1405. S.ContextActionService:BindActionToInputTypes("MouseMove", function(name, state, inputObject)
  1406. print'lol'
  1407. x = (-inputObject.Delta.x/250)
  1408. y = (-inputObject.Delta.y/250)
  1409. if y > 1.5 then
  1410. y = 1.5
  1411. elseif y < -1.5 then
  1412. y = -1.5
  1413. end
  1414. end, false, Enum.UserInputType.MouseMovement)
  1415.  
  1416. coroutine.wrap(function()
  1417. while true do
  1418. S.UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
  1419. Root.CFrame = CFrame.new(Root.Position) * CFrame.Angles(0,x,0)
  1420. Cam.CFrame = Cam.CFrame:lerp(Root.CFrame * CFrame.new(Shoulder,2,6) * CF.A(y,0,0),.2)
  1421. swait()
  1422. end
  1423. end)()
  1424. ]]
  1425.  
  1426.  
  1427. --// Wrap it all up \\--
  1428.  
  1429. local Fired = 0
  1430. coroutine.wrap(function()
  1431.  
  1432. while true do
  1433. if(Equipped and Shooting and Ammo[1] > 0)then
  1434. if(time()-Timer >= 1 and DebugMode)then
  1435. Timer = time()
  1436. print("Fired rounds: "..Fired)
  1437. Fired = 0
  1438. end
  1439. Bullet{
  1440. Origin=Scar.Barrel.CFrame,
  1441. Speed=870
  1442. }
  1443. Fired = Fired + 1
  1444. Ammo[1] = Ammo[1] - 1
  1445. warn("Ammo: "..Ammo[1])
  1446. swait(Frame_Speed/RPS)
  1447. else
  1448. swait()
  1449. end
  1450. end
  1451. end)()
  1452.  
  1453. while true do
  1454. swait()
  1455. Sine = Sine + Change
  1456. if(not Music)then
  1457. Music = Sound(Char,MusicID,1,3,true,false,true)
  1458. Music.Name = 'Music'
  1459. end
  1460. Music.SoundId = "rbxassetid://"..MusicID
  1461. Music.Parent = Char
  1462. Music.Pitch = 1
  1463. Music.Volume = (Whistling and .5 or 3)
  1464. if(not Muted)then
  1465. Music:Resume()
  1466. else
  1467. Music:Pause()
  1468. end
  1469.  
  1470.  
  1471. if(God)then
  1472. Hum.MaxHealth = 1e100
  1473. Hum.Health = 1e100
  1474. if(not Char:FindFirstChildOfClass'ForceField')then IN("ForceField",Char).Visible = false end
  1475. Hum.Name = M.RNG()*100
  1476. end
  1477.  
  1478. local hitfloor,posfloor = workspace:FindPartOnRay(Ray.new(Root.CFrame.p,((CFrame.new(Root.Position,Root.Position - Vector3.new(0,1,0))).lookVector).unit * (4*PlayerSize)), Char)
  1479.  
  1480. local Walking = (math.abs(Root.Velocity.x) > 1 or math.abs(Root.Velocity.z) > 1)
  1481. local State = (Hum.PlatformStand and 'Paralyzed' or Hum.Sit and 'Sit' or not hitfloor and Root.Velocity.y < -1 and "Fall" or not hitfloor and Root.Velocity.y > 1 and "Jump" or hitfloor and Walking and "Walk" or hitfloor and "Idle")
  1482. if(not Effects or not Effects.Parent)then
  1483. Effects = IN("Model",Char)
  1484. Effects.Name = "Effects"
  1485. end
  1486.  
  1487. if(State == 'Walk')then
  1488. local wsVal = 28 / (Hum.WalkSpeed/14)
  1489. local Alpha = math.min(.2 * (Hum.WalkSpeed/16),1)
  1490. Change = 3
  1491. RH.C1 = RH.C1:lerp(CF.N(0,1,0)*CF.N(0,0-.2*M.C(Sine/wsVal),0+.4*M.C(Sine/wsVal))*CF.A(M.R(15+25*M.C(Sine/wsVal))+-M.S(Sine/wsVal),0,0),Alpha)
  1492. LH.C1 = LH.C1:lerp(CF.N(0,1,0)*CF.N(0,0+.2*M.C(Sine/wsVal),0-.4*M.C(Sine/wsVal))*CF.A(M.R(15-25*M.C(Sine/wsVal))+M.S(Sine/wsVal),0,0),Alpha)
  1493. else
  1494. RH.C1 = RH.C1:lerp(CF.N(0,1,0),.2)
  1495. LH.C1 = LH.C1:lerp(CF.N(0,1,0),.2)
  1496. end
  1497.  
  1498. Hum.WalkSpeed = WalkSpeed
  1499.  
  1500. if(NeutralAnims)then
  1501. if(State == 'Idle')then
  1502. local Alpha = .1
  1503. Change = .9
  1504. if(Equipped)then
  1505. LS.C0 = LS.C0:lerp(LSC0*CF.N(1.2,0,-1.2)*CF.A(M.R(105),0,M.R(35)),Alpha)
  1506. RS.C0 = RS.C0:lerp(RSC0*CF.N(0,-.15,.65)*CF.A(M.R(90),0,M.R(-35)),Alpha)
  1507. HW.C0 = HW.C0:lerp(CF.N(0,-1,0)*CF.A(M.R(-90),M.R(-35),0),Alpha)
  1508. else
  1509. LS.C0 = LS.C0:lerp(LSC0*CF.N(0,-.1*M.S(Sine/15),0),Alpha)
  1510. RS.C0 = RS.C0:lerp(RSC0*CF.N(0,-.1*M.S(Sine/15),0),Alpha)
  1511. HW.C0 = HW.C0:lerp(CF.N(0,-.5,.5)*CF.A(0,M.R(90),0)*CF.A(M.R(25),0,0),Alpha)
  1512. end
  1513. RJ.C0 = RJ.C0:lerp(RJC0*CF.N(0,-.1*M.C(Sine/16),0),Alpha)
  1514. NK.C0 = NK.C0:lerp(NKC0,Alpha)
  1515. LH.C0 = LH.C0:lerp(LHC0*CF.N(0,.1*M.C(Sine/16),0),Alpha)
  1516. RH.C0 = RH.C0:lerp(RHC0*CF.N(0,.1*M.C(Sine/16),0),Alpha)
  1517. -- idle
  1518. elseif(State == 'Walk')then
  1519. local wsVal = 28 / (Hum.WalkSpeed/14)
  1520. local Alpha = math.min(.2 * (Hum.WalkSpeed/16),1)
  1521. if(Equipped)then
  1522. LS.C0 = LS.C0:lerp(LSC0*CF.N(1.2,0-.1*M.C(Sine/(wsVal/2)),-1.2)*CF.A(M.R(105),0,M.R(35)),Alpha)
  1523. RS.C0 = RS.C0:lerp(RSC0*CF.N(0,-.15-.1*M.C(Sine/(wsVal/2)),.65)*CF.A(M.R(90),0,M.R(-35)),Alpha)
  1524. HW.C0 = HW.C0:lerp(CF.N(0,-1,0)*CF.A(M.R(-90),M.R(-35),0),Alpha)
  1525. else
  1526. LS.C0 = LS.C0:lerp(LSC0*CF.N(0,0,0-.3*M.S(Sine/wsVal))*CF.A(M.R(0+45*M.S(Sine/wsVal)),0,M.R(-5)),Alpha)
  1527. RS.C0 = RS.C0:lerp(RSC0*CF.N(0,0,0+.3*M.S(Sine/wsVal))*CF.A(M.R(0-45*M.S(Sine/wsVal)),0,M.R(5)),Alpha)
  1528. HW.C0 = HW.C0:lerp(CF.N(0,-.5,.5)*CF.A(0,M.R(90),0)*CF.A(M.R(25),0,0),Alpha)
  1529. end
  1530. RJ.C0 = RJ.C0:lerp(CF.N(0,0-.1*M.C(Sine/(wsVal/2)),0),Alpha)
  1531. NK.C0 = NK.C0:lerp(NKC0,Alpha)
  1532. LH.C0 = LH.C0:lerp(LHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0),Alpha)
  1533. RH.C0 = RH.C0:lerp(RHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0),Alpha)
  1534. elseif(State == 'Jump')then
  1535. local Alpha = .1
  1536. local idk = math.min(math.max(Root.Velocity.Y/50,-M.R(90)),M.R(90))
  1537. if(Equipped)then
  1538. LS.C0 = LS.C0:lerp(LSC0*CF.N(1.2,0,-1.2)*CF.A(M.R(105),0,M.R(35)),Alpha)
  1539. RS.C0 = RS.C0:lerp(RSC0*CF.N(0,-.15,.65)*CF.A(M.R(90),0,M.R(-35)),Alpha)
  1540. HW.C0 = HW.C0:lerp(CF.N(0,-1,0)*CF.A(M.R(-90),M.R(-35),0),Alpha)
  1541. else
  1542. LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)),Alpha)
  1543. RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)),Alpha)
  1544. HW.C0 = HW.C0:lerp(CF.N(0,-.5,.5)*CF.A(0,M.R(90),0)*CF.A(M.R(25),0,0),Alpha)
  1545. end
  1546. RJ.C0 = RJ.C0:lerp(RJC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha)
  1547. NK.C0 = NK.C0:lerp(NKC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha)
  1548. LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha)
  1549. RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha)
  1550. elseif(State == 'Fall')then
  1551. local Alpha = .1
  1552. local idk = math.min(math.max(Root.Velocity.Y/50,-M.R(90)),M.R(90))
  1553. if(Equipped)then
  1554. LS.C0 = LS.C0:lerp(LSC0*CF.N(1.2,0,-1.2)*CF.A(M.R(105),0,M.R(35)),Alpha)
  1555. RS.C0 = RS.C0:lerp(RSC0*CF.N(0,-.15,.65)*CF.A(M.R(90),0,M.R(-35)),Alpha)
  1556. HW.C0 = HW.C0:lerp(CF.N(0,-1,0)*CF.A(M.R(-90),M.R(-35),0),Alpha)
  1557. else
  1558. LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)+idk),Alpha)
  1559. RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)-idk),Alpha)
  1560. HW.C0 = HW.C0:lerp(CF.N(0,-.5,.5)*CF.A(0,M.R(90),0)*CF.A(M.R(25),0,0),Alpha)
  1561. end
  1562. RJ.C0 = RJ.C0:lerp(RJC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha)
  1563. NK.C0 = NK.C0:lerp(NKC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha)
  1564. LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha)
  1565. RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha)
  1566. elseif(State == 'Paralyzed')then
  1567. -- paralyzed
  1568. elseif(State == 'Sit')then
  1569. -- sit
  1570. end
  1571. end
  1572. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement