Advertisement
KrYn0MoRe

animator module

Aug 28th, 2022 (edited)
950
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.63 KB | None | 0 0
  1. local function init()
  2.     local JointData = {}
  3.     JointData["Right Shoulder"] = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  4.     JointData["Left Shoulder"] = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  5.     JointData["Right Hip"] = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  6.     JointData["Left Hip"] = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  7.     JointData["Neck"] = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  8.     JointData["RootJoint"] = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  9.  
  10.     local Animator = {}
  11.     local Playing = {}
  12.     local JointC0 = {}
  13.    
  14.     local GlobalPlaying = _G['GlobalPlaying']
  15.     if not GlobalPlaying then
  16.         _G['GlobalPlaying'] = {}
  17.         GlobalPlaying = _G['GlobalPlaying']
  18.     end
  19.    
  20.     local global_welds = _G['global_welds']
  21.     if not global_welds then
  22.         _G['global_welds'] = {}
  23.         global_welds = _G['global_welds']
  24.     end
  25.  
  26.     local TS = game:GetService("TweenService")
  27.  
  28.     local function Ver(Model)
  29.         if Model and Model.Parent then
  30.             if not GlobalPlaying[Model] then
  31.                 GlobalPlaying[Model] = {}
  32.             end
  33.             if not Playing[Model] then
  34.                 Playing[Model] = {}
  35.                 return true
  36.             end
  37.         end
  38.     end
  39.  
  40.     function Animator.create_welds(targchar)
  41.         if not global_welds[targchar] then else
  42.             return
  43.         end
  44.  
  45.         local anim_welds = {}
  46.         local char_welds = {}
  47.  
  48.         for i,v in ipairs(targchar:GetDescendants()) do
  49.             if v:IsA("Motor6D") or v:IsA("Weld") then
  50.                 if game:GetService("CollectionService"):HasTag(v,'fakemotor') then
  51.                     anim_welds[v] = v.Part0
  52.                 elseif game:GetService("CollectionService"):HasTag(v,'realmotor') then
  53.                     char_welds[v] = v.Part0
  54.                 end
  55.             end
  56.         end
  57.  
  58.         for i,v in ipairs(targchar:GetDescendants()) do
  59.             if v:IsA("Motor6D") and not char_welds[v] then
  60.                 local m = Instance.new("Weld")
  61.                 m.Name = v.Name
  62.                 m.Part0 = v.Part0
  63.                 m.Part1 = v.Part1
  64.                 m.C0 = v.C0
  65.                 m.C1 = v.C1
  66.                 m.Parent = v.Parent
  67.  
  68.                 game:GetService("CollectionService"):AddTag(m,'fakemotor')
  69.                 game:GetService("CollectionService"):AddTag(v,'realmotor')
  70.  
  71.                 anim_welds[m] = v.Part0
  72.                 char_welds[v] = v.Part0
  73.             end
  74.         end
  75.  
  76.         global_welds[targchar] = {
  77.             anim_welds = anim_welds,
  78.             char_welds = char_welds,
  79.             taid = 0,
  80.         }
  81.     end
  82.  
  83.     function Animator.toggle_anim(mode,targchar)
  84.         local welds = global_welds[targchar]
  85.  
  86.         if welds then else
  87.             return
  88.         end
  89.  
  90.         welds.taid += 1
  91.         local cid = welds.taid
  92.  
  93.         local function run()
  94.             if cid == welds.taid then else return end
  95.             if mode then
  96.                 for i,v in pairs(welds.anim_welds) do
  97.                     i.Enabled = true
  98.                 end
  99.                 for i,v in pairs(welds.char_welds) do
  100.                     i.Enabled = false
  101.                 end
  102.             else
  103.                 for i,v in pairs(welds.char_welds) do
  104.                     i.Enabled = true
  105.                 end
  106.                 for i,v in pairs(welds.anim_welds) do
  107.                     i.Enabled = false
  108.                 end
  109.             end
  110.         end
  111.  
  112.         if not mode then
  113.             --task.delay(0.2,run)
  114.             run()
  115.         else
  116.             run()
  117.         end
  118.  
  119.         return cid
  120.     end
  121.  
  122.     function Animator.get_aid(targchar)
  123.         local welds = global_welds[targchar]
  124.         return welds.taid
  125.     end
  126.  
  127.     local function Play(self, FadeIn, Speed, Looped)
  128.         self.TimePosition = 0
  129.         self.StartInternal = os.clock()
  130.  
  131.         self.FadeIn = FadeIn or 0
  132.         self.Speed = Speed or self.Speed
  133.         self.Looped = Looped or self.Looped
  134.         self.LastPlayed = os.clock()
  135.         self.fired = {}
  136.         self.RecoverFade = {}
  137.  
  138.         local StopEvent = Instance.new("BindableEvent")
  139.         self.Stopped = StopEvent.Event
  140.         self.StopEvent = StopEvent
  141.  
  142.         local LoopedEvent = Instance.new("BindableEvent")
  143.         self.OnLooped = LoopedEvent.Event
  144.         self.LoopedEvent = LoopedEvent
  145.  
  146.         local KeyframeReachedEvent = Instance.new("BindableEvent")
  147.         self.KeyframeReached = KeyframeReachedEvent.Event
  148.         self.KeyframeReachedEvent = KeyframeReachedEvent
  149.  
  150.         local MarkerReachedEvent = Instance.new("BindableEvent")
  151.         self.MarkerReached = MarkerReachedEvent.Event
  152.         self.MarkerReachedEvent = MarkerReachedEvent
  153.  
  154.         local I = Playing[self.Model]
  155.         if I then else
  156.             return
  157.         end
  158.         self.Playing = true
  159.         I[self] = true
  160.     end
  161.  
  162.     local function Stop(self,fire)
  163.         local I = Playing[self.Model]
  164.         if I then
  165.             if fire then
  166.                 self.StopEvent:Fire()
  167.             end
  168.         end
  169.  
  170.         self.LastPlayed = 0
  171.         self.Playing = false
  172.         I[self] = nil
  173.  
  174.         self.Stopped = nil
  175.         if self.StopEvent then
  176.             self.StopEvent:Destroy()
  177.         end
  178.         self.StopEvent = nil
  179.  
  180.         self.OnLooped = nil
  181.         if self.StopEvent then
  182.             self.LoopedEvent:Destroy()
  183.         end
  184.         self.LoopedEvent = nil
  185.  
  186.         self.KeyframeReached = nil
  187.         if self.StopEvent then
  188.             self.KeyframeReachedEvent:Destroy()
  189.         end
  190.         self.KeyframeReachedEvent = nil
  191.  
  192.         self.MarkerReached = nil
  193.         if self.StopEvent then
  194.             self.MarkerReachedEvent:Destroy()
  195.         end
  196.         self.MarkerReachedEvent = nil
  197.  
  198.         self.FadeIn = nil
  199.     end
  200.  
  201.     local function Resume(self)
  202.         if self.PauseInternal then
  203.             self.StartInternal = os.clock() - self.PauseInternal
  204.         end
  205.         local I = Playing[self.Model]
  206.         self.Playing = true
  207.         I[self] = true
  208.     end
  209.  
  210.     local function Pause(self)
  211.         local TimeSince = os.clock() - self.StartInternal
  212.         self.PauseInternal = TimeSince
  213.         local I = Playing[self.Model]
  214.         self.Playing = false
  215.         I[self] = nil
  216.     end
  217.  
  218.     local function SetTime(self, Time)
  219.         self.StartInternal = os.clock() - Time
  220.     end
  221.  
  222.     local function AdjustSpeed(self, NewSpeed)
  223.         self.Speed = NewSpeed
  224.     end
  225.  
  226.     local function ft(t,c)
  227.         for i,v in pairs(t) do
  228.             --if i == 'Parent' or i == 'Name' or i == 'Marker' or i == 'Time' or i == 'CF' then continue end
  229.             if typeof(v) == 'table' then
  230.                 ft(v,true)
  231.                 local name = v.Name
  232.                 v.Name = nil
  233.                 local index_t = {
  234.                     Parent = t,
  235.                     Name = name or i,
  236.                 }
  237.                 if v.Marker then
  238.                     index_t.Marker = v.Marker
  239.                     v.Marker = nil
  240.                 end
  241.                 if v.Time then
  242.                     index_t.Time = v.Time
  243.                     v.Time = nil
  244.                 end
  245.                 if v.CF then
  246.                     index_t.CF = v.CF
  247.                     v.CF = nil
  248.                 end
  249.                 if tonumber(i) and not v.CF then
  250.                     index_t.Time = tonumber(i)
  251.                 end
  252.                 v = setmetatable(v,{
  253.                     __index = index_t
  254.                 })
  255.             end
  256.         end
  257.         return t
  258.     end
  259.  
  260.     local function iter(t)
  261.         local new_t = {}
  262.         for i,v in pairs(t) do
  263.             --if i == 'Parent' or i == 'Name' or i == 'Marker' or i == 'Time' or i == 'CF' then continue end
  264.             table.insert(new_t,v)
  265.             if typeof(v) == 'table' then
  266.                 for ii,vv in pairs(iter(v)) do
  267.                     table.insert(new_t,vv)
  268.                 end
  269.             end
  270.         end
  271.         return new_t
  272.     end
  273.  
  274.     local ModelAnimations = {}
  275.     local hasloaded = {}
  276.     local TrackKeyframes = {}
  277.  
  278.     function Animator.Preload(Track)
  279.         if TrackKeyframes[Track] then
  280.             return TrackKeyframes[Track]
  281.         end
  282.  
  283.         Track.Keyframes = ft(Track.Keyframes)
  284.         local kf = Track.Keyframes
  285.         table.sort(kf, function(a, b) return a.Time < b.Time end)
  286.  
  287.         local Keyframes = {}
  288.         local jdata = {}
  289.         local largest_time = 0
  290.  
  291.         do
  292.             for STime, SKeyframe in next, kf do
  293.                 STime = tonumber(STime)
  294.                 if STime > largest_time then
  295.                     largest_time = STime
  296.                 end
  297.                 local descendants = iter(SKeyframe)
  298.  
  299.                 local function set_marker(name)
  300.                     if not Keyframes['_null'] then
  301.                         Keyframes['_null'] = {}
  302.                     end
  303.                     Keyframes['_null'][#Keyframes['_null'] + 1] = {Time = STime, Name = name, Marker = 1, ["Info"] = nil}
  304.                 end
  305.  
  306.                 if 0 >= #descendants then
  307.                     set_marker(SKeyframe.Name)
  308.                 end
  309.                 for _,Pose in next, descendants do
  310.                     if typeof(Pose) ~= 'table' then continue end
  311.                     if Pose.Name == 'HumanoidRootPart' then continue end
  312.  
  313.                     if Pose.Marker then
  314.                         set_marker(Pose.Name)
  315.                     end
  316.  
  317.                     local P0 = Pose.Parent.Name
  318.                     local P1 = Pose.Name
  319.  
  320.                     local JT = Keyframes[P0..'KEyjtsep'..P1]
  321.                     if not JT then
  322.                         JT = {}
  323.                         Keyframes[P0..'KEyjtsep'..P1] = JT
  324.                         jdata[P0..'KEyjtsep'..P1] = 1
  325.                     end
  326.  
  327.                     local Style = Pose.ES or 'Linear'
  328.                     local Direction = Pose.ED or 'In'
  329.                     local Weight = Pose.Weight or 1
  330.                     local PCF = Pose.CF
  331.  
  332.                     if not PCF then continue end
  333.                    
  334.                     local CF
  335.                     for i,v in pairs(PCF) do
  336.                         PCF[i] = tonumber(v)
  337.                     end
  338.  
  339.                     if PCF[1] then
  340.                         CF = CFrame.new(PCF[1],PCF[2],PCF[3])
  341.                     else
  342.                         CF = CFrame.new()
  343.                     end
  344.                     if PCF[4] then
  345.                         CF = CF*CFrame.Angles(PCF[4],PCF[5],PCF[6])
  346.                     end
  347.  
  348.                     local Info = {EasingStyle = Style, EasingDirection = Direction, Weight = Weight, CFrame = CF}
  349.  
  350.                     JT[#JT+1] = {Time = STime, Name = SKeyframe.Name, ["Info"] = Info}
  351.                 end
  352.             end
  353.  
  354.             for Joint,Poses in pairs(Keyframes) do
  355.                 table.sort(Poses, function(a, b) return a.Time < b.Time end)
  356.             end
  357.  
  358.             TrackKeyframes[Track] = {
  359.                 Keyframes,
  360.                 jdata,
  361.                 largest_time
  362.             }
  363.  
  364.             return TrackKeyframes[Track]
  365.         end
  366.     end
  367.  
  368.     function Animator.LoadAnimation(Track, Model)
  369.         assert(Track,'No track.')
  370.         assert(Model,'No model.')
  371.         local notmodel
  372.         if not ModelAnimations[Model] then
  373.             notmodel = true
  374.             ModelAnimations[Model] = {}
  375.             ModelAnimations[Model].Joints = {}
  376.         elseif ModelAnimations[Model][Track] then
  377.             return ModelAnimations[Model][Track]
  378.         end
  379.         local Animation = {}
  380.         ModelAnimations[Model][Track] = Animation
  381.  
  382.         if not hasloaded[Track] then
  383.             Track.Properties.Priority = Enum.AnimationPriority[Track.Properties.Priority]
  384.         end
  385.  
  386.         local set_model = Ver(Model)
  387.  
  388.         local largest_time = 0
  389.  
  390.         if not GlobalPlaying[Model][Animation] then
  391.             GlobalPlaying[Model][Animation] = {}
  392.         end
  393.  
  394.         if notmodel then
  395.             local function new_joint(Obj)
  396.                 if Obj:IsA("Weld") then
  397.                     local P0 = Obj.Part0
  398.                     local P1 = Obj.Part1
  399.                     if not P0 or not P1 then return end
  400.  
  401.                     local jd = JointData[Obj.Name]
  402.                     if jd then
  403.                         Obj.C0 = jd
  404.                         JointC0[Obj] = jd
  405.                     else
  406.                         JointC0[Obj] = Obj.C0
  407.                     end
  408.  
  409.                     local T = ModelAnimations[Model].Joints[P0.Name]
  410.                     if not T then
  411.                         T = {}
  412.                         ModelAnimations[Model].Joints[P0.Name] = T
  413.                     end
  414.                     if not T[P1.Name] then
  415.                         T[P1.Name] = Obj
  416.                     end
  417.                 end
  418.             end
  419.  
  420.             for _,v in ipairs(Model:GetDescendants()) do
  421.                 new_joint(v)
  422.             end
  423.             Model.DescendantAdded:Connect(new_joint)
  424.         end
  425.  
  426.         local track_data = Animator.Preload(Track)
  427.         if track_data then
  428.             local Keyframes,jdata,lt = unpack(track_data)
  429.             Animation.Keyframes = Keyframes
  430.             GlobalPlaying[Model][Animation] = jdata
  431.             largest_time = lt
  432.         else
  433.             error('No track preloaded.')
  434.         end
  435.  
  436.         Animation.TimePosition = 0
  437.         Animation.TimeLength = largest_time
  438.         Animation.Track = Track
  439.         Animation.Model = Model
  440.         Animation.TimeScale = 1
  441.         Animation.GeneralWeight = 1
  442.         Animation.Play = Play
  443.         Animation.Stop = Stop
  444.         Animation.Resume = Resume
  445.         Animation.Pause = Pause
  446.         Animation.SetTime = SetTime
  447.         Animation.AdjustSpeed = AdjustSpeed
  448.         Animation.Looped = Track.Properties.Looping or false
  449.         Animation.Speed = 1
  450.         Animation.FadeIn = 0
  451.         Animation.LastPlayed = 0
  452.         Animation.i = 0
  453.         Animation.Playing = false
  454.         Animation.fired = {}
  455.         Animation.RecoverFade = {}
  456.  
  457.         if Track.Properties.Priority == Enum.AnimationPriority.Idle then
  458.             Animation.Priority = 1
  459.         elseif Track.Properties.Priority == Enum.AnimationPriority.Movement then
  460.             Animation.Priority = 2
  461.         elseif Track.Properties.Priority == Enum.AnimationPriority.Action then
  462.             Animation.Priority = 3
  463.         else--if Track.Properties.Priority == Enum.AnimationPriority.Core then
  464.             Animation.Priority = 0
  465.         end
  466.  
  467.         Animation.StartInternal = 0
  468.         Animation.PauseInternal = 0
  469.  
  470.         Animation.GetTimeOfKeyframe = function(name)
  471.             for Time,v in ipairs(Animation.Keyframes) do
  472.                 if v.Name == name then
  473.                     return Time
  474.                 end
  475.             end
  476.         end
  477.  
  478.         hasloaded[Track] = true
  479.  
  480.         return Animation
  481.     end
  482.  
  483.     local CF = CFrame.new()
  484.     local function GetPose(TimeSince, Poses, Joint, Animation)
  485.         for i = 1,#Poses do
  486.             local Keyframe = Poses[i]
  487.             local NextKeyframe = Poses[i+1]
  488.             local Time = Keyframe.Time
  489.  
  490.             --local JT = Joint.Transform
  491.  
  492.             if TimeSince >= Time then
  493.                 if not Animation.fired[Keyframe.Name .. Time] and Keyframe.Name ~= 'Keyframe' then
  494.                     Animation.fired[Keyframe.Name .. Time] = 1
  495.                     if Keyframe.Marker then -- keymarker
  496.                         Animation.MarkerReachedEvent:Fire(Keyframe.Name)
  497.                     else -- keyframe
  498.                         Animation.KeyframeReachedEvent:Fire(Keyframe.Name)
  499.                     end
  500.                 end
  501.             end
  502.  
  503.             if (TimeSince >= Time) or Poses[1].Time > TimeSince then
  504.                 if NextKeyframe then
  505.                     local NextTime = NextKeyframe.Time
  506.                     if TimeSince < NextTime then
  507.                         if Keyframe.Marker then
  508.                             return {nil, nil, Keyframe.Name, Time, Keyframe.Marker}
  509.                         end
  510.                         local Info1 = Keyframe.Info
  511.                         local Info2 = NextKeyframe.Info
  512.  
  513.                         local Alpha = (TimeSince - Time) / (NextTime - Time)
  514.  
  515.                         local CFA = CF:Lerp(Info1.CFrame, Info1.Weight)
  516.                         local CFB = CF:Lerp(Info2.CFrame, Info2.Weight)
  517.  
  518.                         local Pose
  519.                         if Info2.EasingStyle == 'Constant' then
  520.                             Pose = CFA
  521.                         else
  522.                             Pose = CFA:Lerp(CFB, TS:GetValue(Alpha, Enum.EasingStyle[Info2.EasingStyle], Enum.EasingDirection[Info2.EasingDirection]))
  523.                         end
  524.  
  525.                         return {Joint, Pose, Keyframe.Name, Time}
  526.                     end
  527.                 else
  528.                     if Keyframe.Marker then
  529.                         return {nil, nil, Keyframe.Name, Time, Keyframe.Marker}
  530.                     end
  531.                     return {Joint, Keyframe.Info.CFrame, Keyframe.Name, Time}
  532.                 end
  533.             end
  534.         end
  535.     end
  536.  
  537.     local total_playing = 0
  538.  
  539.     local function UpdatePlaying()
  540.         local tp = 0
  541.         for Model, Animations in next, Playing do
  542.             for Animation,_ in next, Animations do
  543.                 if not Animation.Playing then
  544.                     continue
  545.                 end
  546.                 if not Model or not Model.Parent then
  547.                     Playing[Model] = nil
  548.                     Animation.FadeIn = nil
  549.                     Animation.fired = {}
  550.                     Animation.Playing = false
  551.  
  552.                     continue
  553.                 end
  554.  
  555.                 local TimeSince = Animation.StartInternal
  556.                 TimeSince = os.clock() - ((os.clock() - TimeSince) * Animation.Speed)
  557.                 TimeSince = os.clock() - TimeSince
  558.  
  559.                 --local TimeSince = os.clock() - Animation.StartInternal
  560.                 --TimeSince = TimeSince * Animation.Speed
  561.  
  562.                 if Animation.FadeIn then
  563.                     Animation.OFadeIn = Animation.FadeIn
  564.                 end
  565.  
  566.                 local Length = Animation.TimeLength
  567.  
  568.                 if TimeSince > Length then
  569.                     Animation.FadeIn = nil
  570.                     Animation.fired = {}
  571.                     if Animation.Looped then
  572.                         Animation.LoopedEvent:Fire()
  573.                         if 0 >= Length then
  574.                             TimeSince = 0
  575.                         else
  576.                             TimeSince = TimeSince%Length
  577.                         end
  578.                         --Animation.StartInternal += Length-TimeSince
  579.                     else
  580.                         Animation.TimePosition = 0
  581.                         Playing[Model][Animation] = nil
  582.                         Animation.Playing = false
  583.                         Animation.StopEvent:Fire()
  584.                         continue
  585.                     end
  586.                 end
  587.  
  588.                 local Keyframes = Animation.Keyframes
  589.  
  590.                 if Keyframes then else continue end
  591.                 tp += 1
  592.                 local ToAnimate = {}
  593.                 local StartFade = nil
  594.                 for Joint, Poses in pairs(Keyframes) do
  595.                     local strjoint = Joint
  596.                     local jd = string.split(strjoint,'KEyjtsep')
  597.                     local Joint
  598.                     if jd[1] and jd[2] then
  599.                         Joint = ModelAnimations[Model].Joints[jd[1]]
  600.                         if not Joint then
  601.                             continue
  602.                         end
  603.                         Joint = Joint[jd[2]]
  604.                         if not Joint then
  605.                             continue
  606.                         end
  607.                     end
  608.                     if not Poses[1] or not Poses[1].Marker then
  609.                         local f,fade
  610.                         for i,using in pairs(GlobalPlaying[Model]) do
  611.                             if i ~= Animation then else
  612.                                 continue
  613.                             end
  614.                             if i.Playing then else
  615.                                 continue
  616.                             end
  617.                             if using[strjoint] then else
  618.                                 continue
  619.                             end
  620.                             if i.Priority > Animation.Priority or (i.Priority == Animation.Priority and i.LastPlayed > Animation.LastPlayed) then else
  621.                                 continue
  622.                             end
  623.                             f = true
  624.                         end
  625.                         if f then
  626.                             Animation.RecoverFade[Joint.Name] = os.clock()
  627.                             continue
  628.                         end
  629.                     end
  630.                     if Poses[1] and Poses[1].Time > TimeSince then
  631.                         --StartFade = Poses[1].Time * Animation.Speed
  632.                     end
  633.  
  634.                     ToAnimate[#ToAnimate+1] = GetPose(TimeSince, Poses, Joint, Animation)
  635.                 end
  636.                 for i = 1,#ToAnimate do
  637.                     local Pose = ToAnimate[i]
  638.                     if not Pose[5] then
  639.                         local TCF = Pose[2]
  640.                         local FadeIn = Animation.FadeIn
  641.                         local RF = Animation.RecoverFade[Pose[1].Name]
  642.                         local TimeSince = TimeSince
  643.                         if RF then
  644.                             TimeSince = os.clock()-RF
  645.                             if TimeSince >= Length then
  646.                                 Animation.RecoverFade[Pose[1].Name] = nil
  647.                             else
  648.                                 FadeIn = Animation.OFadeIn
  649.                             end
  650.                         end
  651.                         TCF = JointC0[Pose[1]] * TCF
  652.                         if StartFade then
  653.                             TCF = Pose[1].C0:Lerp(TCF, TimeSince / StartFade)
  654.                         elseif FadeIn and TimeSince < FadeIn then
  655.                             TCF = Pose[1].C0:Lerp(TCF, TimeSince / FadeIn)
  656.                         end
  657.                         Pose[1].C0 = TCF
  658.                     end
  659.                 end
  660.  
  661.                 Animation.TimePosition = TimeSince
  662.             end
  663.         end
  664.         total_playing = tp
  665.     end
  666.  
  667.     function Animator.GetPlaying()
  668.         return total_playing
  669.     end
  670.  
  671.     local con
  672.     if game:GetService("RunService"):IsClient() then
  673.         con = game:GetService("RunService").RenderStepped:Connect(UpdatePlaying)
  674.     else
  675.         con = game:GetService("RunService").Stepped:Connect(UpdatePlaying)
  676.     end
  677.  
  678.     return Animator,con
  679. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement