Advertisement
SirSkyvalky

Untitled

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