Advertisement
KrYn0MoRe

rogue lineage spell

Aug 26th, 2022 (edited)
1,209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 33.38 KB | None | 0 0
  1. -- animator
  2.  
  3. local function init()
  4.     local JointData = {}
  5.     JointData["Right Shoulder"] = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  6.     JointData["Left Shoulder"] = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  7.     JointData["Right Hip"] = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  8.     JointData["Left Hip"] = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  9.     JointData["Neck"] = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  10.     JointData["RootJoint"] = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  11.  
  12.     local Animator = {}
  13.     local Playing = {}
  14.     local GlobalPlaying = {}
  15.     local JointC0 = {}
  16.  
  17.     local TS = game:GetService("TweenService")
  18.  
  19.     local function Ver(Model)
  20.         if Model and Model.Parent then
  21.             if not Playing[Model] then
  22.                 Playing[Model] = {}
  23.                 return true
  24.             end
  25.         end
  26.     end
  27.  
  28.     local function Play(self, FadeIn, Speed, Looped)
  29.         self.TimePosition = 0
  30.         self.StartInternal = os.clock()
  31.  
  32.         self.FadeIn = FadeIn or 0
  33.         self.Speed = Speed or self.Speed
  34.         self.Looped = Looped or self.Looped
  35.         self.LastPlayed = os.clock()
  36.         self.fired = {}
  37.         self.RecoverFade = {}
  38.  
  39.         local StopEvent = Instance.new("BindableEvent")
  40.         self.Stopped = StopEvent.Event
  41.         self.StopEvent = StopEvent
  42.  
  43.         local LoopedEvent = Instance.new("BindableEvent")
  44.         self.OnLooped = LoopedEvent.Event
  45.         self.LoopedEvent = LoopedEvent
  46.  
  47.         local KeyframeReachedEvent = Instance.new("BindableEvent")
  48.         self.KeyframeReached = KeyframeReachedEvent.Event
  49.         self.KeyframeReachedEvent = KeyframeReachedEvent
  50.  
  51.         local MarkerReachedEvent = Instance.new("BindableEvent")
  52.         self.MarkerReached = MarkerReachedEvent.Event
  53.         self.MarkerReachedEvent = MarkerReachedEvent
  54.  
  55.         local I = Playing[self.Model]
  56.         self.Playing = true
  57.         I[self] = true
  58.     end
  59.  
  60.     local function Stop(self,fire)
  61.         local I = Playing[self.Model]
  62.         if I then
  63.             if fire then
  64.                 self.StopEvent:Fire()
  65.             end
  66.         end
  67.  
  68.         self.LastPlayed = 0
  69.         self.Playing = false
  70.         I[self] = nil
  71.  
  72.         self.Stopped = nil
  73.         if self.StopEvent then
  74.             self.StopEvent:Destroy()
  75.         end
  76.         self.StopEvent = nil
  77.  
  78.         self.OnLooped = nil
  79.         if self.StopEvent then
  80.             self.LoopedEvent:Destroy()
  81.         end
  82.         self.LoopedEvent = nil
  83.  
  84.         self.KeyframeReached = nil
  85.         if self.StopEvent then
  86.             self.KeyframeReachedEvent:Destroy()
  87.         end
  88.         self.KeyframeReachedEvent = nil
  89.  
  90.         self.MarkerReached = nil
  91.         if self.StopEvent then
  92.             self.MarkerReachedEvent:Destroy()
  93.         end
  94.         self.MarkerReachedEvent = nil
  95.  
  96.         self.FadeIn = nil
  97.     end
  98.  
  99.     local function Resume(self)
  100.         if self.PauseInternal then
  101.             self.StartInternal = os.clock() - self.PauseInternal
  102.         end
  103.         local I = Playing[self.Model]
  104.         self.Playing = true
  105.         I[self] = true
  106.     end
  107.  
  108.     local function Pause(self)
  109.         local TimeSince = os.clock() - self.StartInternal
  110.         self.PauseInternal = TimeSince
  111.         local I = Playing[self.Model]
  112.         self.Playing = false
  113.         I[self] = nil
  114.     end
  115.  
  116.     local function SetTime(self, Time)
  117.         self.StartInternal = os.clock() - Time
  118.     end
  119.  
  120.     local function AdjustSpeed(self, NewSpeed)
  121.         self.Speed = NewSpeed
  122.     end
  123.  
  124.     local function ft(t,c)
  125.         for i,v in pairs(t) do
  126.             if i == 'Parent' or i == 'Name' or i == 'Marker' or i == 'Time' or i == 'CF' then continue end
  127.             if tonumber(i) and not v.CF then
  128.                 v.Time = tonumber(i)
  129.             end
  130.             if typeof(v) == 'table' then
  131.                 ft(v,true)
  132.                 local name = v.Name
  133.                 v.Name = nil
  134.                 v = setmetatable(v,{
  135.                     __index = {
  136.                         Parent = t,
  137.                         Name = name or i,
  138.                     }
  139.                 })
  140.             end
  141.         end
  142.         return t
  143.     end
  144.  
  145.     local function iter(t)
  146.         local new_t,n = {},0
  147.         for i,v in pairs(t) do
  148.             if i == 'Parent' or i == 'CF' then continue end
  149.             n = n + 1
  150.             new_t[n] = v
  151.             if typeof(v) == 'table' then
  152.                 for ii,vv in pairs(iter(v)) do
  153.                     n = n + 1
  154.                     new_t[n] = vv
  155.                 end
  156.             end
  157.         end
  158.         return new_t,n
  159.     end
  160.  
  161.     local Animations = {}
  162.  
  163.     function Animator.LoadAnimation(Track, Model)
  164.         assert(Track,'No track.')
  165.         assert(Model,'No model.')
  166.         if Animations[Track] then
  167.             return Animations[Track]
  168.         end
  169.         local Animation = {}
  170.         Animations[Track] = Animation
  171.  
  172.         Track.Properties.Priority = Enum.AnimationPriority[Track.Properties.Priority]
  173.         Track.Keyframes = ft(Track.Keyframes)
  174.  
  175.         local kf = Track.Keyframes
  176.         table.sort(kf, function(a, b) return a.Time < b.Time end)
  177.         local Keyframes = {}
  178.  
  179.         local set_model = Ver(Model)
  180.  
  181.         local largest_time = 0
  182.  
  183.         if true then
  184.             local Joints = {}
  185.  
  186.             local function set_joint()
  187.                 for STime, SKeyframe in next, kf do
  188.                     STime = tonumber(STime)
  189.                     if STime > largest_time then
  190.                         largest_time = STime
  191.                     end
  192.  
  193.                     local descendants,n = iter(SKeyframe)
  194.  
  195.                     local function set_marker(name)
  196.                         if not Keyframes['_null'] then
  197.                             Keyframes['_null'] = {}
  198.                         end
  199.                         Keyframes['_null'][#Keyframes['_null'] + 1] = {Time = STime, Name = name, Marker = 1, ["Info"] = nil}
  200.                     end
  201.  
  202.                     if 0 >= n then
  203.                         set_marker(SKeyframe.Name)
  204.                     end
  205.                     for _,Pose in next, descendants do
  206.                         if typeof(Pose) ~= 'table' then continue end
  207.                         if Pose.Name == 'HumanoidRootPart' then continue end
  208.  
  209.                         if Pose.Marker then
  210.                             set_marker(Pose.Name)
  211.                         end
  212.  
  213.                         local P0Name = Pose.Parent.Name
  214.                         local P1Name = Pose.Name
  215.                         local IP0 = Joints[Pose.Parent.Name]
  216.                         if not IP0 then continue end
  217.                         local Joint = IP0[Pose.Name]
  218.                         if not Joint then continue end
  219.  
  220.                         local JT = Keyframes[Joint]
  221.                         if not JT then
  222.                             JT = {}
  223.                             Keyframes[Joint] = JT
  224.                             if not JointC0[Joint] then
  225.                                 local jd = JointData[Joint.Name]
  226.                                 if jd then
  227.                                     Joint.C0 = jd
  228.                                     JointC0[Joint] = jd
  229.                                 else
  230.                                     JointC0[Joint] = Joint.C0
  231.                                 end
  232.                             end
  233.                         end
  234.  
  235.                         local Style = Pose.ES or 'Linear'
  236.                         local Direction = Pose.ED or 'In'
  237.                         local Weight = Pose.Weight or 1
  238.                         local PCF = Pose.CF
  239.  
  240.                         if not PCF then continue end
  241.  
  242.                         local CF
  243.                         for i,v in pairs(PCF) do
  244.                             PCF[i] = tonumber(v)
  245.                         end
  246.  
  247.                         if PCF[1] then
  248.                             CF = CFrame.new(PCF[1],PCF[2],PCF[3])
  249.                         else
  250.                             CF = CFrame.new()
  251.                         end
  252.                         if PCF[4] then
  253.                             CF = CF*CFrame.Angles(math.rad(PCF[4]),math.rad(PCF[5]),math.rad(PCF[6]))
  254.                         end
  255.  
  256.                         local Info = {EasingStyle = Style, EasingDirection = Direction, Weight = Weight, CFrame = CF}
  257.  
  258.                         if not GlobalPlaying[Animation] then
  259.                             GlobalPlaying[Animation] = {}
  260.                         end
  261.                         GlobalPlaying[Animation][Joint.Name] = 1
  262.  
  263.                         JT[#JT+1] = {Time = STime, Name = SKeyframe.Name, ["Info"] = Info}
  264.                     end
  265.                 end
  266.                 Animation.Keyframes = Keyframes
  267.                 for Joint,Poses in pairs(Keyframes) do
  268.                     table.sort(Poses, function(a, b) return a.Time < b.Time end)
  269.                 end
  270.                 if not Animation.using then
  271.                     Animation.using = {}
  272.                 end
  273.                 for i,v in pairs(iter(Track.Keyframes)) do
  274.                     if typeof(v) == 'table' and v.CF then
  275.                         Animation.using[v.Name] = 1
  276.                     end
  277.                 end
  278.             end
  279.  
  280.             local function new_joint(Obj,d)
  281.                 if Obj:IsA("Weld") then
  282.                     local P0 = Obj.Part0
  283.                     local P1 = Obj.Part1
  284.                     if not P0 or not P1 then return end
  285.  
  286.                     local jd = JointData[Obj.Name]
  287.                     if jd then
  288.                         Obj.C0 = jd
  289.                         JointC0[Obj] = jd
  290.                     end
  291.  
  292.                     local T = Joints[P0.Name]
  293.                     if not T then
  294.                         T = {}
  295.                         Joints[P0.Name] = T
  296.                     end
  297.                     T[P1.Name] = Obj
  298.                     --if not d then
  299.                     set_joint()
  300.                     --end
  301.                 end
  302.             end
  303.  
  304.             for _,obj in next, Model:GetDescendants() do
  305.                 new_joint(obj)
  306.             end
  307.  
  308.             Model.DescendantAdded:Connect(new_joint)
  309.  
  310.             set_joint()
  311.         end
  312.         Animation.TimePosition = 0
  313.         Animation.TimeLength = largest_time
  314.         Animation.kf = kf
  315.         Animation.Track = Track
  316.         Animation.Model = Model
  317.         Animation.TimeScale = 1
  318.         Animation.GeneralWeight = 1
  319.         Animation.Play = Play
  320.         Animation.Stop = Stop
  321.         Animation.Resume = Resume
  322.         Animation.Pause = Pause
  323.         Animation.SetTime = SetTime
  324.         Animation.AdjustSpeed = AdjustSpeed
  325.         Animation.Looped = Track.Properties.Looping or false
  326.         Animation.Speed = 1
  327.         Animation.FadeIn = 0
  328.         Animation.LastPlayed = 0
  329.         Animation.i = 0
  330.         Animation.Playing = false
  331.         Animation.fired = {}
  332.         Animation.RecoverFade = {}
  333.  
  334.         if Track.Properties.Priority == Enum.AnimationPriority.Core then
  335.             Animation.Priority = 0
  336.         elseif Track.Properties.Priority == Enum.AnimationPriority.Idle then
  337.             Animation.Priority = 1
  338.         elseif Track.Properties.Priority == Enum.AnimationPriority.Movement then
  339.             Animation.Priority = 2
  340.         elseif Track.Properties.Priority == Enum.AnimationPriority.Action then
  341.             Animation.Priority = 3
  342.         end
  343.  
  344.         Animation.StartInternal = 0
  345.         Animation.PauseInternal = 0
  346.  
  347.         Animation.GetTimeOfKeyframe = function(name)
  348.             for Time,v in ipairs(Keyframes) do
  349.                 if v.Name == name then
  350.                     return Time
  351.                 end
  352.             end
  353.         end
  354.  
  355.         return Animation
  356.     end
  357.  
  358.     local CF = CFrame.new()
  359.     local function GetPose(TimeSince, Poses, Joint)
  360.         for i = 1,#Poses do
  361.             local Keyframe = Poses[i]
  362.             local NextKeyframe = Poses[i+1]
  363.             local Time = Keyframe.Time
  364.  
  365.             --local JT = Joint.Transform
  366.             if (TimeSince >= Time) or Poses[1].Time > TimeSince then
  367.                 if NextKeyframe then
  368.                     local NextTime = NextKeyframe.Time
  369.                     if TimeSince < NextTime then
  370.                         if Keyframe.Marker then
  371.                             return {nil, nil, Keyframe.Name, Time, Keyframe.Marker}
  372.                         end
  373.                         local Info1 = Keyframe.Info
  374.                         local Info2 = NextKeyframe.Info
  375.  
  376.                         local Alpha = (TimeSince - Time) / (NextTime - Time)
  377.  
  378.                         local CFA = CF:Lerp(Info1.CFrame, Info1.Weight)
  379.                         local CFB = CF:Lerp(Info2.CFrame, Info2.Weight)
  380.  
  381.                         local Pose = CFA:Lerp(CFB, TS:GetValue(Alpha, Enum.EasingStyle[Info2.EasingStyle], Enum.EasingDirection[Info2.EasingDirection]))
  382.  
  383.                         return {Joint, Pose, Keyframe.Name, Time}
  384.                     end
  385.                 else
  386.                     if Keyframe.Marker then
  387.                         return {nil, nil, Keyframe.Name, Time, Keyframe.Marker}
  388.                     end
  389.                     return {Joint, Keyframe.Info.CFrame, Keyframe.Name, Time}
  390.                 end
  391.             end
  392.         end
  393.     end
  394.  
  395.     local total_playing = 0
  396.  
  397.     local function UpdatePlaying()
  398.         local tp = 0
  399.         for Model, Animations in next, Playing do
  400.             for Animation,_ in next, Animations do
  401.                 if not Model or not Model.Parent then
  402.                     Playing[Model] = nil
  403.                     Animation.FadeIn = nil
  404.                     Animation.fired = {}
  405.                     Animation.Playing = false
  406.  
  407.                     continue
  408.                 end
  409.  
  410.                 local TimeSince = Animation.StartInternal
  411.                 TimeSince = os.clock() - ((os.clock() - TimeSince) * Animation.Speed)
  412.                 TimeSince = os.clock() - TimeSince
  413.                 --TimeSince = TimeSince * Animation.Speed
  414.  
  415.                 if Animation.FadeIn then
  416.                     Animation.OFadeIn = Animation.FadeIn
  417.                 end
  418.  
  419.                 local Length = Animation.TimeLength
  420.  
  421.                 if TimeSince > Length then
  422.                     Animation.FadeIn = nil
  423.                     Animation.fired = {}
  424.                     if Animation.Looped then
  425.                         Animation.LoopedEvent:Fire()
  426.                         if 0 >= Length then
  427.                             TimeSince = 0
  428.                         else
  429.                             TimeSince = TimeSince%Length
  430.                         end
  431.                         --Animation.StartInternal += Length-TimeSince
  432.                     else
  433.                         Animation.TimePosition = 0
  434.                         Playing[Model][Animation] = nil
  435.                         Animation.Playing = false
  436.                         Animation.StopEvent:Fire()
  437.                         continue
  438.                     end
  439.                 end
  440.  
  441.                 local Keyframes = Animation.Keyframes
  442.  
  443.                 if Keyframes then else continue end
  444.                 tp += 1
  445.                 local ToAnimate = {}
  446.                 local StartFade = nil
  447.                 for Joint, Poses in pairs(Keyframes) do
  448.                     if not Poses[1] or not Poses[1].Marker then
  449.                         local f,fade
  450.                         for i,using in pairs(GlobalPlaying) do
  451.                             if i ~= Animation then else
  452.                                 continue
  453.                             end
  454.                             if i.Playing then else
  455.                                 continue
  456.                             end
  457.                             if using[Joint.Name] then else
  458.                                 continue
  459.                             end
  460.                             if i.Priority > Animation.Priority or (i.Priority == Animation.Priority and i.LastPlayed > Animation.LastPlayed) then else
  461.                                 continue
  462.                             end
  463.                             f = true
  464.                         end
  465.                         if f then
  466.                             Animation.RecoverFade[Joint.Name] = os.clock()
  467.                             continue
  468.                         end
  469.                     end
  470.                     if Poses[1] and Poses[1].Time > TimeSince then
  471.                         --StartFade = Poses[1].Time * Animation.Speed
  472.                     end
  473.                     ToAnimate[#ToAnimate+1] = GetPose(TimeSince, Poses, Joint)
  474.                 end
  475.                 for i = 1,#ToAnimate do
  476.                     local Pose = ToAnimate[i]
  477.                     if not Pose[5] then
  478.                         local TCF = Pose[2]
  479.                         local FadeIn = Animation.FadeIn
  480.                         local RF = Animation.RecoverFade[Pose[1].Name]
  481.                         local TimeSince = TimeSince
  482.                         if RF then
  483.                             TimeSince = os.clock()-RF
  484.                             if TimeSince >= Length then
  485.                                 Animation.RecoverFade[Pose[1].Name] = nil
  486.                             else
  487.                                 FadeIn = Animation.OFadeIn
  488.                             end
  489.                         end
  490.                         TCF = JointC0[Pose[1]] * TCF
  491.                         if StartFade then
  492.                             TCF = Pose[1].C0:Lerp(TCF, TimeSince / StartFade)
  493.                         elseif FadeIn and TimeSince < FadeIn then
  494.                             TCF = Pose[1].C0:Lerp(TCF, TimeSince / FadeIn)
  495.                         end
  496.                         Pose[1].C0 = TCF
  497.                     end
  498.                     if not Animation.fired[Pose[3] .. Pose[4]] and Pose[3] ~= 'Keyframe' then
  499.                         Animation.fired[Pose[3] .. Pose[4]] = 1
  500.                         if not Pose[4] then -- keyframe
  501.                             Animation.KeyframeReachedEvent:Fire(Pose[3])
  502.                         elseif Pose[5] then -- keymarker
  503.                             Animation.MarkerReachedEvent:Fire(Pose[3])
  504.                         end
  505.                     end
  506.                 end
  507.  
  508.                 Animation.TimePosition = TimeSince
  509.             end
  510.         end
  511.         total_playing = tp
  512.     end
  513.  
  514.     function Animator.GetPlaying()
  515.         return total_playing
  516.     end
  517.  
  518.     local con
  519.     if game:GetService("RunService"):IsClient() then
  520.         con = game:GetService("RunService").RenderStepped:Connect(UpdatePlaying)
  521.     else
  522.         con = game:GetService("RunService").Stepped:Connect(UpdatePlaying)
  523.     end
  524.  
  525.     return Animator,con
  526. end
  527.  
  528. -- anims
  529.  
  530. local default_anims = game:GetService("HttpService"):GetAsync('https://pastebin.com/raw/0JSVJpVB')
  531. default_anims = game:GetService("HttpService"):JSONDecode(default_anims)
  532.  
  533. -- anims
  534.  
  535. local anims = game:GetService("HttpService"):GetAsync('https://pastebin.com/raw/ayCM7FuF')
  536. anims = game:GetService("HttpService"):JSONDecode(anims)
  537.  
  538. -- starter
  539.  
  540. local plr = owner
  541. local char = plr.Character
  542. local hum = char:FindFirstChildOfClass("Humanoid")
  543. local root = char:FindFirstChild("HumanoidRootPart")
  544.  
  545. if hum.RigType == Enum.HumanoidRigType.R6 then else
  546.     warn('Humanoid is not R6')
  547.     return
  548. end
  549.  
  550. --
  551.  
  552. local animate = char.Animate
  553. local animator = hum.Animator
  554.  
  555. local anim_welds = {}
  556. local char_welds = {}
  557.  
  558. for i,v in pairs(char:GetDescendants()) do
  559.     if v:IsA("Motor6D") then
  560.         local m = Instance.new("Weld")
  561.         m.Name = v.Name
  562.         m.Part0 = v.Part0
  563.         m.Part1 = v.Part1
  564.         m.C0 = v.C0
  565.         m.C1 = v.C1
  566.         m.Parent = v.Parent
  567.  
  568.         anim_welds[m] = m.Part0
  569.         char_welds[v] = v.Part0
  570.     end
  571. end
  572.  
  573. local idle_anim = Instance.new("Animation")
  574. idle_anim.AnimationId = 'rbxassetid://125750544'
  575. idle_anim.Parent = hum
  576.  
  577. local taid = 0
  578.  
  579. function toggle_anim(mode)
  580.     taid += 1
  581.     local cid = taid
  582.  
  583.     local function run()
  584.         if cid == taid then else return end
  585.         if mode then
  586.             for i,v in pairs(anim_welds) do
  587.                 i.Part0 = v
  588.             end
  589.         else
  590.             for i,v in pairs(anim_welds) do
  591.                 i.Part0 = nil
  592.             end
  593.         end
  594.     end
  595.  
  596.     if not mode then
  597.         task.delay(0.2,run)
  598.     else
  599.         run()
  600.     end
  601.  
  602.     return cid
  603. end
  604.  
  605. function get_aid()
  606.     return taid
  607. end
  608.  
  609. --
  610.  
  611. local animator,con = init()
  612.  
  613. function load(anim)
  614.     return animator.LoadAnimation(anim,char)
  615. end
  616.  
  617. local move_anims = {
  618.     fall = {
  619.         anim = load(default_anims.fall),
  620.         fade = 0.3,
  621.     },
  622.     climb = {
  623.         anim = load(default_anims.climb),
  624.         fade = 0.2,
  625.     },
  626.     jump = {
  627.         anim = load(default_anims.jump),
  628.         fade = 0.2,
  629.     },
  630.     walk = {
  631.         anim = load(default_anims.walk),
  632.         fade = 0.2,
  633.     },
  634.     idle = {
  635.         anim = load(default_anims.idle),
  636.         fade = 0.3,
  637.     },
  638.     sit = {
  639.         anim = load(default_anims.sit),
  640.         fade = 0.5,
  641.     },
  642. }
  643.  
  644. local jumped = false
  645. local current_move = nil
  646.  
  647. function play_move_anim(cid)
  648.     if not cid then
  649.         for id,data in pairs(move_anims) do
  650.             if data.anim.Playing then
  651.                 data.anim:Stop()
  652.             end
  653.         end
  654.         return
  655.     end
  656.     local data = move_anims[cid]
  657.     if cid == 'walk' then
  658.         data.anim:AdjustSpeed(hum.WalkSpeed/16)
  659.     end
  660.     if not data.anim.Playing then
  661.         local old_data = move_anims[current_move]
  662.         if old_data then
  663.             old_data.anim:Stop()
  664.         end
  665.         current_move = cid
  666.         data.anim:Play(data.fade, nil, true)
  667.     end
  668. end
  669.  
  670. --
  671.  
  672. function sleep(n)
  673.     return task.wait(n or 0)
  674. end
  675.  
  676. local function wrap(func)
  677.     coroutine.resume(coroutine.create(func))
  678. end
  679.  
  680. function play_sound(par,id,vol,speed,loop,perm)
  681.     local s = Instance.new("Sound")
  682.     s.SoundId = 'rbxassetid://' .. id
  683.     s.Volume = vol or 0.5
  684.     s.PlaybackSpeed = speed or 1
  685.     s.Looped = loop or false
  686.     s.Parent = par or root
  687.     if not perm then
  688.         s:Play()
  689.     end
  690.     if not loop and not perm then
  691.         s.Ended:Connect(function()
  692.             sleep()
  693.             s:Destroy()
  694.         end)
  695.     end
  696.     return s
  697. end
  698.  
  699. --
  700.  
  701. local cs = game:GetService("CollectionService")
  702.  
  703. do
  704.     local tool = Instance.new("Tool")
  705.     tool.Name = 'Ignis'
  706.     tool.RequiresHandle = false
  707.     tool.CanBeDropped = false
  708.     tool.Parent = plr:FindFirstChildOfClass("Backpack")
  709.  
  710.     cs:AddTag(tool,'spell')
  711.  
  712.     local debounce = false
  713.     local cid
  714.  
  715.     local function stop()
  716.         cs:RemoveTag(tool,'using')
  717.         debounce = true
  718.         if cid == get_aid() then
  719.             toggle_anim(false)
  720.         end
  721.         task.delay(2,function()
  722.             debounce = false
  723.         end)
  724.     end
  725.  
  726.     local function check()
  727.         if not cs:HasTag(tool,'using') or hum.PlatformStand then
  728.             stop()
  729.             return true
  730.         end
  731.     end
  732.  
  733.     local function use()
  734.         cs:AddTag(tool,'using')
  735.  
  736.         local last
  737.         for i = 1,6 do
  738.             if check() then
  739.                 return
  740.             end
  741.  
  742.             local anim = load(anims['wand' .. i])
  743.             anim:Play(0.15)
  744.             if last then
  745.                 last:Stop()
  746.             end
  747.             last = anim
  748.             play_sound(root,1026964101,0.5,2)
  749.             sleep(0.2)
  750.  
  751.         end
  752.  
  753.         if check() then
  754.             return
  755.         end
  756.  
  757.         local anim = load(anims.point)
  758.         anim.Looped = true
  759.         anim:Play(0.2)
  760.         last:Stop()
  761.  
  762.         --local s = play_sound(root,9117988356,0.4,1)
  763.  
  764.         local s = play_sound(root,303632290,0.5,1,true)
  765.  
  766.         local params = OverlapParams.new()
  767.         params.FilterDescendantsInstances = {char}
  768.         params.FilterType = Enum.RaycastFilterType.Blacklist
  769.         params.MaxParts = 100
  770.  
  771.         local ParticleEmitter0 = Instance.new("ParticleEmitter")
  772.         ParticleEmitter0.Parent = char['Right Arm'].RightGripAttachment
  773.         ParticleEmitter0.Speed = NumberRange.new(15, 15)
  774.         ParticleEmitter0.Color = ColorSequence.new(Color3.new(1, 0.666667, 0),Color3.new(1, 0, 0))
  775.         ParticleEmitter0.LightEmission = 0.5
  776.         ParticleEmitter0.Texture = "rbxassetid://5234388158"
  777.         ParticleEmitter0.Transparency = NumberSequence.new({
  778.             NumberSequenceKeypoint.new(0,0),
  779.             NumberSequenceKeypoint.new(0.7,0),
  780.             NumberSequenceKeypoint.new(1,1),
  781.         })
  782.         ParticleEmitter0.Acceleration = Vector3.new(0,0,0)
  783.         ParticleEmitter0.ZOffset = 0.5
  784.         ParticleEmitter0.Size = NumberSequence.new({
  785.             NumberSequenceKeypoint.new(0,0),
  786.             NumberSequenceKeypoint.new(0.146,0.438),
  787.             NumberSequenceKeypoint.new(0.875,0.875),
  788.             NumberSequenceKeypoint.new(1,1.56),
  789.         })
  790.         ParticleEmitter0.EmissionDirection = Enum.NormalId.Bottom
  791.         ParticleEmitter0.Lifetime = NumberRange.new(0.7, 0.7)
  792.         ParticleEmitter0.LockedToPart = false
  793.         ParticleEmitter0.Rate = 150
  794.         ParticleEmitter0.RotSpeed = NumberRange.new(200, 200)
  795.         ParticleEmitter0.SpreadAngle = Vector2.new(25, 25)
  796.         ParticleEmitter0.VelocitySpread = 25
  797.         ParticleEmitter0.Enabled = true
  798.  
  799.         local lbox
  800.  
  801.         local function fire()
  802.             local hit = {}
  803.             local box = Instance.new("Part")
  804.             box.Transparency = 1
  805.             box.Size = Vector3.new(5,5,8)
  806.             box.CFrame = char['Right Arm'].CFrame * CFrame.new(0,-1-4.5-1,0)*CFrame.Angles(math.rad(90),0,0)
  807.             box.Anchored = false
  808.             box.CanCollide = false
  809.             box.Massless = true
  810.             box.Locked = true
  811.             box.Parent = workspace
  812.  
  813.             if lbox then
  814.                 lbox:Destroy()
  815.             end
  816.             lbox = box
  817.  
  818.             for i,obj in ipairs(workspace:GetPartsInPart(box,params)) do
  819.                 local targchar = obj.Parent
  820.                 local targhum
  821.                 pcall(function()
  822.                     targhum = targchar:FindFirstChildOfClass("Humanoid")
  823.                 end)
  824.                 local targroot
  825.                 pcall(function()
  826.                     targroot = targchar:FindFirstChild("HumanoidRootPart") or targchar:FindFirstChild("Torso")
  827.                 end)
  828.                 if targchar and not hit[targchar] and targhum and targroot then
  829.                     hit[targchar] = {targchar,targroot,obj}
  830.                     local ms = targhum:GetAttribute('mana_shield')
  831.                     if ms and ms == 2 then
  832.                         return
  833.                     end
  834.                     local burning = targhum:GetAttribute('burning')
  835.                     targhum:SetAttribute('burning',os.clock())
  836.                     targhum:SetAttribute('freeze',nil)
  837.                     if not burning then
  838.                         local p = ParticleEmitter0:Clone()
  839.                         p.EmissionDirection = Enum.NormalId.Top
  840.                         p.LockedToPart = true
  841.                         p.Speed = NumberRange.new(1)
  842.                         p.SpreadAngle = Vector2.new(0, 0)
  843.                         p.Acceleration = Vector3.new(0,0,0)
  844.                         p.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0, 0))
  845.                         p.Texture = "rbxassetid://288279969"
  846.                         p.Rate = 100
  847.                         p.Parent = targroot
  848.  
  849.                         local dir = (targroot.Position-root.Position).Unit
  850.  
  851.                         local bvel = Instance.new("BodyVelocity")
  852.                         bvel.MaxForce = Vector3.new(1/0,1/0,1/0)
  853.                         bvel.Velocity = dir*40+Vector3.new(0,5,0)
  854.                         bvel.Parent = targroot
  855.                         game:GetService("Debris"):AddItem(bvel,0.1)
  856.  
  857.                         local s = play_sound(targroot,303632290,0.5,1,true)
  858.  
  859.                         coroutine.wrap(function()
  860.                             while true do
  861.                                 burning = targhum:GetAttribute('burning') or 0
  862.                                 if 13.75 >= os.clock()-burning and targchar and targchar.Parent then else
  863.                                     if targhum then
  864.                                         targhum:SetAttribute('burning',nil)
  865.                                         targhum.PlatformStand = false
  866.                                     end
  867.                                     if p then
  868.                                         p.Enabled = false
  869.                                         task.delay(1.1,function()
  870.                                             p:Destroy()
  871.                                         end)
  872.                                     end
  873.                                     if s then
  874.                                         s:Destroy()
  875.                                     end
  876.                                     break
  877.                                 end
  878.                                 if 2 >= os.clock()-burning then
  879.                                     targhum.PlatformStand = true
  880.                                 else
  881.                                     targhum.PlatformStand = false
  882.                                 end
  883.                                 targhum:TakeDamage(3.5)
  884.                                 sleep(0.5)
  885.                             end
  886.                         end)()
  887.                     end
  888.                 end
  889.             end
  890.         end
  891.  
  892.         local st = os.clock()
  893.  
  894.         repeat
  895.             fire()
  896.             sleep(0.1)
  897.         until os.clock()-st >= 5 or check()
  898.  
  899.         anim:Stop()
  900.         if s then
  901.             s:Destroy()
  902.         end
  903.         if ParticleEmitter0 then
  904.             ParticleEmitter0:Destroy()
  905.         end
  906.  
  907.         stop()
  908.     end
  909.  
  910.     tool.Activated:Connect(function()
  911.         if debounce then
  912.             return
  913.         end
  914.         if hum:GetAttribute('mana_shield') then
  915.             return
  916.         end
  917.         if cs:HasTag(tool,'using') then
  918.             return
  919.         end
  920.         cid = toggle_anim(true)
  921.         use()
  922.     end)
  923.     tool.Unequipped:Connect(function()
  924.         cs:RemoveTag(tool,'using')
  925.     end)
  926. end
  927.  
  928. do
  929.     local tool = Instance.new("Tool")
  930.     tool.Name = 'Gelidus'
  931.     tool.RequiresHandle = false
  932.     tool.CanBeDropped = false
  933.     tool.Parent = plr:FindFirstChildOfClass("Backpack")
  934.  
  935.     cs:AddTag(tool,'spell')
  936.  
  937.     local debounce = false
  938.     local cid
  939.  
  940.     local function stop()
  941.         cs:RemoveTag(tool,'using')
  942.         debounce = true
  943.         if cid == get_aid() then
  944.             toggle_anim(false)
  945.         end
  946.         task.delay(2,function()
  947.             debounce = false
  948.         end)
  949.     end
  950.  
  951.     local function check()
  952.         if not cs:HasTag(tool,'using') or hum.PlatformStand then
  953.             stop()
  954.             return true
  955.         end
  956.     end
  957.  
  958.     local function use()
  959.         cs:AddTag(tool,'using')
  960.  
  961.         local last
  962.         for i = 1,6 do
  963.             if check() then
  964.                 return
  965.             end
  966.  
  967.             local anim = load(anims['wand' .. i])
  968.             anim:Play(0.15)
  969.             if last then
  970.                 last:Stop()
  971.             end
  972.             last = anim
  973.             play_sound(root,1026964101,0.5,2)
  974.             sleep(0.2)
  975.  
  976.         end
  977.  
  978.         if check() then
  979.             return
  980.         end
  981.  
  982.         local anim = load(anims.point)
  983.         anim.Looped = true
  984.         anim:Play(0.2)
  985.         last:Stop()
  986.  
  987.         --local s = play_sound(root,9117988356,0.4,1)
  988.  
  989.         local s = play_sound(root,362395087,0.5,1,true)
  990.  
  991.         local params = OverlapParams.new()
  992.         params.FilterDescendantsInstances = {char}
  993.         params.FilterType = Enum.RaycastFilterType.Blacklist
  994.         params.MaxParts = 100
  995.  
  996.         local ParticleEmitter0 = Instance.new("ParticleEmitter")
  997.         ParticleEmitter0.Parent = char['Right Arm'].RightGripAttachment
  998.         ParticleEmitter0.Speed = NumberRange.new(15, 15)
  999.         ParticleEmitter0.Color = ColorSequence.new(Color3.new(1, 1, 1),Color3.new(0.333333, 1, 1))
  1000.         ParticleEmitter0.LightEmission = 0.5
  1001.         ParticleEmitter0.Texture = "rbxassetid://5234388158"
  1002.         ParticleEmitter0.Transparency = NumberSequence.new({
  1003.             NumberSequenceKeypoint.new(0,0),
  1004.             NumberSequenceKeypoint.new(0.7,0),
  1005.             NumberSequenceKeypoint.new(1,1),
  1006.         })
  1007.         ParticleEmitter0.Acceleration = Vector3.new(0,0,0)
  1008.         ParticleEmitter0.ZOffset = 0.5
  1009.         ParticleEmitter0.Size = NumberSequence.new({
  1010.             NumberSequenceKeypoint.new(0,0),
  1011.             NumberSequenceKeypoint.new(0.146,0.438),
  1012.             NumberSequenceKeypoint.new(0.875,0.875),
  1013.             NumberSequenceKeypoint.new(1,1.56),
  1014.         })
  1015.         ParticleEmitter0.EmissionDirection = Enum.NormalId.Bottom
  1016.         ParticleEmitter0.Lifetime = NumberRange.new(0.7, 0.7)
  1017.         ParticleEmitter0.LockedToPart = false
  1018.         ParticleEmitter0.Rate = 150
  1019.         ParticleEmitter0.RotSpeed = NumberRange.new(200, 200)
  1020.         ParticleEmitter0.SpreadAngle = Vector2.new(25, 25)
  1021.         ParticleEmitter0.VelocitySpread = 25
  1022.         ParticleEmitter0.Enabled = true
  1023.  
  1024.         local lbox
  1025.  
  1026.         local function fire()
  1027.             local hit = {}
  1028.             local box = Instance.new("Part")
  1029.             box.Transparency = 1
  1030.             box.Size = Vector3.new(5,5,8)
  1031.             box.CFrame = char['Right Arm'].CFrame * CFrame.new(0,-1-4.5-1,0)*CFrame.Angles(math.rad(90),0,0)
  1032.             box.Anchored = false
  1033.             box.CanCollide = false
  1034.             box.Massless = true
  1035.             box.Locked = true
  1036.             box.Parent = workspace
  1037.  
  1038.             if lbox then
  1039.                 lbox:Destroy()
  1040.             end
  1041.             lbox = box
  1042.  
  1043.             for i,obj in ipairs(workspace:GetPartsInPart(box,params)) do
  1044.                 local targchar = obj.Parent
  1045.                 local targhum
  1046.                 pcall(function()
  1047.                     targhum = targchar:FindFirstChildOfClass("Humanoid")
  1048.                 end)
  1049.                 local targroot
  1050.                 pcall(function()
  1051.                     targroot = targchar:FindFirstChild("HumanoidRootPart") or targchar:FindFirstChild("Torso")
  1052.                 end)
  1053.                 if targchar and not hit[targchar] and targhum and targroot then
  1054.                     hit[targchar] = {targchar,targroot,obj}
  1055.                     local ms = targhum:GetAttribute('mana_shield')
  1056.                     if ms and ms == 2 then
  1057.                         return
  1058.                     end
  1059.                     local freeze = targhum:GetAttribute('freeze')
  1060.                     targhum:SetAttribute('freeze',os.clock())
  1061.                     targhum:SetAttribute('burning',nil)
  1062.                     if not freeze then
  1063.                         targhum:TakeDamage(1)
  1064.                         local Part0 = Instance.new("Part")
  1065.                         Part0.CFrame = CFrame.new(-15.7232018, 3, 13.8946533, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1066.                         Part0.Position = Vector3.new(-15.723201751708984, 3, 13.8946533203125)
  1067.                         Part0.Color = Color3.new(0, 1, 1)
  1068.                         Part0.Transparency = 0.5
  1069.                         Part0.Size = Vector3.new(5, 6, 5)
  1070.                         Part0.BottomSurface = Enum.SurfaceType.Smooth
  1071.                         Part0.BrickColor = BrickColor.new("Toothpaste")
  1072.                         Part0.Material = Enum.Material.Ice
  1073.                         Part0.TopSurface = Enum.SurfaceType.Smooth
  1074.                         Part0.brickColor = BrickColor.new("Toothpaste")
  1075.                         Part0.Massless = true
  1076.                         Part0.CanCollide = false
  1077.                         Part0.Anchored = false
  1078.  
  1079.                         local w = Instance.new("Motor6D")
  1080.                         w.Part0 = targroot
  1081.                         w.Part1 = Part0
  1082.                         w.Parent = Part0
  1083.  
  1084.                         Part0.Parent = targroot
  1085.  
  1086.                         local dir = (targroot.Position-root.Position).Unit
  1087.  
  1088.                         local bvel = Instance.new("BodyVelocity")
  1089.                         bvel.MaxForce = Vector3.new(1/0,1/0,1/0)
  1090.                         bvel.Velocity = dir*40+Vector3.new(0,5,0)
  1091.                         bvel.Parent = targroot
  1092.                         game:GetService("Debris"):AddItem(bvel,0.1)
  1093.  
  1094.                         coroutine.wrap(function()
  1095.                             while true do
  1096.                                 freeze = targhum:GetAttribute('freeze') or 0
  1097.                                 if 3 >= os.clock()-freeze and targchar and targchar.Parent then else
  1098.                                     if targhum then
  1099.                                         targhum:SetAttribute('freeze',nil)
  1100.                                         targhum.PlatformStand = false
  1101.                                     end
  1102.                                     if Part0 then
  1103.                                         Part0:Destroy()
  1104.                                     end
  1105.                                     break
  1106.                                 end
  1107.                                 targhum.PlatformStand = true
  1108.                                 sleep(0.1)
  1109.                             end
  1110.                         end)()
  1111.                     end
  1112.                 end
  1113.             end
  1114.         end
  1115.  
  1116.         local st = os.clock()
  1117.  
  1118.         repeat
  1119.             fire()
  1120.             sleep(0.1)
  1121.         until os.clock()-st >= 5 or check()
  1122.  
  1123.         anim:Stop()
  1124.         if s then
  1125.             s:Destroy()
  1126.         end
  1127.         if ParticleEmitter0 then
  1128.             ParticleEmitter0:Destroy()
  1129.         end
  1130.  
  1131.         stop()
  1132.     end
  1133.  
  1134.     tool.Activated:Connect(function()
  1135.         if debounce then
  1136.             return
  1137.         end
  1138.         if hum:GetAttribute('mana_shield') then
  1139.             return
  1140.         end
  1141.         if cs:HasTag(tool,'using') then
  1142.             return
  1143.         end
  1144.         cid = toggle_anim(true)
  1145.         use()
  1146.     end)
  1147.     tool.Unequipped:Connect(function()
  1148.         cs:RemoveTag(tool,'using')
  1149.     end)
  1150. end
  1151.  
  1152. do
  1153.     local holding = {}
  1154.  
  1155.     function block(input)
  1156.         if input.press then
  1157.             local hold = holding[input.key]
  1158.             local tool = char:FindFirstChildOfClass("Tool")
  1159.             local shield_type = 0
  1160.             if tool and cs:HasTag(tool,'spell') then
  1161.                 shield_type = 2
  1162.                 if not cs:HasTag(tool,'using') then else
  1163.                     return
  1164.                 end
  1165.             else
  1166.                 shield_type = 1
  1167.             end
  1168.            
  1169.             if not hum.PlatformStand then else
  1170.                 return
  1171.             end
  1172.            
  1173.             local Part0 = Instance.new("Part")
  1174.             Part0.CFrame = root.CFrame
  1175.             Part0.Color = Color3.fromRGB(111, 31, 217)
  1176.             Part0.Transparency = 0.7
  1177.             Part0.Size = Vector3.new(0,0,0)
  1178.             Part0.Shape = Enum.PartType.Ball
  1179.             Part0.Anchored = false
  1180.             Part0.CanCollide = false
  1181.             Part0.Massless = true
  1182.             Part0.Material = Enum.Material.Neon
  1183.  
  1184.             local w = Instance.new("Motor6D")
  1185.             w.Part0 = root
  1186.             w.Part1 = Part0
  1187.             w.Parent = Part0
  1188.  
  1189.             Part0.Parent = char
  1190.  
  1191.             hum:SetAttribute('mana_shield',shield_type)
  1192.             local exists = 1
  1193.             local hcc
  1194.             if shield_type == 2 then -- magic
  1195.                 Part0.BrickColor = BrickColor.new("Royal purple")
  1196.                 char.ChildRemoved:Connect(function(obj)
  1197.                     if obj == tool then
  1198.                         exists = nil
  1199.                     end
  1200.                 end)
  1201.             else -- physical
  1202.                 Part0.BrickColor = BrickColor.new("Institutional white")
  1203.                 local oldhp = hum.Health
  1204.                 hcc = hum.HealthChanged:Connect(function(newhp)
  1205.                     local change = oldhp-newhp
  1206.                     if change > 0 then
  1207.                         hum.Health = newhp + change
  1208.                         local s = play_sound(root,8460106618,0.4)
  1209.                     end
  1210.                     oldhp = hum.Health
  1211.                 end)
  1212.                 exists = nil
  1213.                 char.ChildAdded:Connect(function(obj)
  1214.                     if obj:IsA("Tool") then
  1215.                         exists = 1
  1216.                     end
  1217.                 end)
  1218.             end
  1219.  
  1220.             game:GetService("TweenService"):Create(Part0,TweenInfo.new(0.5),{
  1221.                 Size = Vector3.new(7,7,7)
  1222.             }):Play()
  1223.            
  1224.             local function stop()
  1225.                 if Part0 then
  1226.                     game:GetService("TweenService"):Create(Part0,TweenInfo.new(0.5),{
  1227.                         Size = Vector3.new(0,0,0)
  1228.                     }):Play()
  1229.                     game:GetService("Debris"):AddItem(Part0,0.5)
  1230.                 end
  1231.                 local s = play_sound(root,588735437,0.6)
  1232.                 hum:SetAttribute('mana_shield',nil)
  1233.                 if hcc then
  1234.                     hcc:Disconnect()
  1235.                 end
  1236.             end
  1237.  
  1238.             local s = play_sound(root,588734767,0.6)
  1239.             while true do
  1240.                 if shield_type == 2 then
  1241.                     if exists then else
  1242.                         stop()
  1243.                         break
  1244.                     end
  1245.                 else
  1246.                     if not exists then else
  1247.                         stop()
  1248.                         break
  1249.                     end
  1250.                 end
  1251.                 if hold == holding[input.key] and not hum.PlatformStand then else
  1252.                     stop()
  1253.                     break
  1254.                 end
  1255.                 sleep()
  1256.             end
  1257.         end
  1258.     end
  1259.  
  1260.     local keys = {
  1261.         [Enum.KeyCode.F] = block,
  1262.     }
  1263.  
  1264.     local remote = Instance.new("RemoteEvent")
  1265.     remote.Parent = char
  1266.  
  1267.     remote.OnServerEvent:Connect(function(lplr,mode,key)
  1268.         if plr == lplr and key then
  1269.             if not holding[key] then
  1270.                 holding[key] = 0
  1271.             end
  1272.             holding[key] += 1
  1273.             local f = keys[key]
  1274.             if f then
  1275.                 f({
  1276.                     press = mode,
  1277.                     key = key,
  1278.                 })
  1279.             end
  1280.         end
  1281.     end)
  1282.  
  1283.     NLS([[
  1284.     local remote = script.Parent
  1285.     local uis = game:GetService("UserInputService")
  1286.     uis.InputBegan:Connect(function(input,press)
  1287.         if not press then else return end
  1288.         local key
  1289.         if input.UserInputType == Enum.UserInputType.Keyboard then
  1290.             key = input.KeyCode
  1291.         elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
  1292.             key = Enum.UserInputType.MouseButton1
  1293.         elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
  1294.             key = Enum.UserInputType.MouseButton2
  1295.         end
  1296.         if key then
  1297.             remote:FireServer(true,key)
  1298.         end
  1299.     end)
  1300.     uis.InputEnded:Connect(function(input,press)
  1301.         local key
  1302.         if input.UserInputType == Enum.UserInputType.Keyboard then
  1303.             key = input.KeyCode
  1304.         elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
  1305.             key = Enum.UserInputType.MouseButton1
  1306.         elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
  1307.             key = Enum.UserInputType.MouseButton2
  1308.         end
  1309.         if key then
  1310.             remote:FireServer(false,key)
  1311.         end
  1312.     end)
  1313.     ]],remote)
  1314. end
  1315.  
  1316. --
  1317.  
  1318. toggle_anim(false)
  1319.  
  1320. print([[
  1321. Rogue Lineage
  1322. - Ignis and Gelidus
  1323. - F - Equipped - block magical
  1324. - F - Unequipped - block physical
  1325. ]])
  1326.  
  1327. local c
  1328. c = game:GetService("RunService").Heartbeat:Connect(function()
  1329.     if not char or not char.Parent or 0 >= hum.Health then
  1330.         c:Disconnect()
  1331.         return
  1332.     end
  1333.     local dir = root.Velocity
  1334.     local params = RaycastParams.new()
  1335.     params.FilterType = Enum.RaycastFilterType.Blacklist
  1336.     params.FilterDescendantsInstances = {char}
  1337.     params.IgnoreWater = false
  1338.     local ground = workspace:Raycast(root.Position,root.CFrame.UpVector*-1*5,params)
  1339.     local jumpvel = dir.Y
  1340.     local walkvel = (dir*Vector3.new(1,0,1)).Magnitude
  1341.     local movevel = dir.Magnitude
  1342.     local faceDir = root.CFrame.lookVector.Unit
  1343.     local moveDir = dir.Unit
  1344.     local dot = faceDir:Dot(moveDir)
  1345.  
  1346.     local moving,air_state
  1347.  
  1348.     if walkvel > 0.01 then
  1349.         moving = true
  1350.     else
  1351.         moving = false
  1352.     end
  1353.  
  1354.     local state = hum:GetState()
  1355.  
  1356.     if state == Enum.HumanoidStateType.Freefall then
  1357.         air_state = 1
  1358.     elseif state == Enum.HumanoidStateType.Jumping then
  1359.         air_state = 2
  1360.     else
  1361.         air_state = 0
  1362.     end
  1363.  
  1364.     if state == Enum.HumanoidStateType.Jumping then
  1365.         jumped = true
  1366.     else
  1367.         jumped = false
  1368.     end
  1369.  
  1370.     if state == Enum.HumanoidStateType.Climbing then
  1371.         play_move_anim('climb')
  1372.     elseif hum.Sit then
  1373.         play_move_anim('sit')
  1374.     elseif air_state == 1 then
  1375.         play_move_anim('fall')
  1376.     elseif air_state == 2 then
  1377.         play_move_anim('jump')
  1378.     elseif moving then
  1379.         play_move_anim('walk')
  1380.     else
  1381.         play_move_anim('idle')
  1382.     end
  1383. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement