Advertisement
InTesting

Animation 1

Dec 14th, 2019
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 15.99 KB | None | 0 0
  1. print'https://pastebin.com/raw/pAYH7pzR'
  2. local function Set_Up_Function(player)
  3.     local Set_Up_1={
  4.         Name='Script_Name_Sample';
  5.         Movement_Range=1;
  6.         Motor6d_Enabled={
  7.             Left_Arm=false;
  8.             Right_Arm=false;
  9.             Left_Leg=false;
  10.             Right_Leg=false;
  11.             };
  12.         Shirt_Asset=true;
  13.         Pants_Asset=true;
  14.         Health=nil;
  15.         WalkSpeed=nil;
  16.         JumpPower=nil;
  17.         Customized_Face_Ids={};
  18.         Destroy_Accessories={
  19.             };
  20.         Destroy_Character_Meshes=false;
  21.         Global_CLerp_Animation_Decimal_Alpha=nil;
  22.        
  23.         };
  24.     local Players,cwrap,Wait_For_Child_2,Storage,RE,RF,clerp,Asset_Prefix=
  25.         game:GetService("Players"),function(a)local b=coroutine.wrap(a);b();return b;end,
  26.         function(p,c,wt)wt=wt or 1/60;local a;if not p or not c then return;end;
  27.         if typeof(p)~='Instance'or typeof(c)~='string'then return;end;repeat
  28.         a=p:FindFirstChild(c);wait(wt);until a;return a;end,{},nil,nil,function(cf,goal,al)
  29.         return cf:Lerp(goal,al);end,'rbxassetid://';
  30.     player=(player=='FindPlayer'and(loadstring('return owner')()or Players:
  31.         GetPlayerFromCharacter(script.Parent)))or player;
  32.     script.Name=Set_Up_1.Name;if not player or not Players then return;end;
  33.     if loadstring('return owner')()then pcall(function()local NLS;NLS=loadstring('return NLS')();
  34.         NLS([[local lp,re,rf=game:GetService'Players'.LocalPlayer,script:WaitForChild'RE_Client',
  35.     script:WaitForChild'RF_Client';local mouse=lp:GetMouse();mouse.KeyDown:Connect(function(k)
  36. re:FireServer('KD',k,mouse.Hit,mouse.Target);end);mouse.Button1Down:Connect(function()re:
  37. FireServer('MB_Down',mouse.Hit,mouse.Target);end);rf.OnClientInvoke=function(...)local args={...};
  38. if args[1]=='Get_Mouse_CF'then return mouse.Hit;elseif args[1]=='Get_Mouse_Target'then
  39. return mouse.Target;end;end;]],script);script.Parent=loadstring('return owner')().Character;
  40.         end);end;
  41.     local pchar,Instance_2,Remove=player.Character or(function()repeat wait(1);player:LoadCharacter();
  42.         until player.Character;return player.Character;end)(),function(c,p)
  43.         local a=(function()for a,b in pairs(Storage)do if b.ClassName==c then
  44.         table.remove(Storage,a);return b;end;end;end)()or Instance.new(c);if not a then
  45.         print'No classname';return;end;for b,c in pairs(p)do local _,d= pcall(function()a[b]=c;end);
  46.         if d then print(d);end;end;return a;end,function(a)a.Parent=nil;table.insert(Storage,a);end;
  47.     if not pchar then return;end;local a=(function()if loadstring('return owner')()then return{
  48.         Instance_2('RemoteEvent',{Name='RE_Client';Parent=script:GetChildren()[1];});
  49.         Instance_2('RemoteFunction',{Name='RF_Client';Parent=script:GetChildren()[1];})};end;
  50.         wait(2);return{script:FindFirstChildWhichIsA('RemoteEvent',true);script:
  51.     FindFirstChildWhichIsA('RemoteFunction',true);}end)();RE,RF=unpack(a);if not RE or not RF then
  52.     return;end;
  53.     local Head,HRootPart,Torso,Humanoid,Left_Arm,Right_Arm,Left_Leg,Right_Leg,Damage,Container=
  54.         (function()local a;repeat a=pchar:FindFirstChild'Head';if a then break;end;wait(1);until nil;
  55.         return a;end)(),(function()local a;repeat a=pchar:FindFirstChild'HumanoidRootPart';if a then
  56.         break;end;wait(1);until nil;return a;end)(),(function()local a;repeat
  57.         a=pchar:FindFirstChild'Torso';if a then break;end;wait(1);until nil;return a;end)(),
  58.         (function()local a;repeat a=pchar:FindFirstChildWhichIsA'Humanoid';if a then break;end;wait(1);
  59.         until nil;return a;end)(),(function()local a;repeat a=pchar:FindFirstChild'Left Arm';if a then
  60.         break;end;wait(1);until nil;return a;end)(),(function()local a;repeat
  61.         a=pchar:FindFirstChild'Right Arm';if a then break;end;wait(1);until nil;return a;end)(),
  62.         (function()local a;repeat a=pchar:FindFirstChild'Left Leg';if a then break;end;wait(1);until
  63.         nil;return a;end)(),(function()local a;repeat a=pchar:FindFirstChild'Right Leg';if a then
  64.         break;end;wait(1);until nil;return a;end)(),function(h,d,f)if not h then return;end;d=d or 10;
  65.         f=f or function()end;local a=h:FindFirstAncestorWhichIsA'Model';
  66.         if not a or a==workspace or a==pchar then return;end;
  67.         local b,c=a:FindFirstChildWhichIsA'Humanoid',a:FindFirstChild'Head'or a:FindFirstChild'Torso'
  68.             or a:FindFirstChild'UpperTorso'or a:FindFirstChild'HumanoidRootPart';
  69.         if b then if b.Health>150 then b.Health=0;else b:TakeDamage(d);end;elseif c then
  70.         Remove(c);else pcall(function()a:BreakJoints();end);end;end,Instance_2('Folder',{Parent=
  71.         pchar});
  72.     local Left_Hip,Left_Shoulder,Neck,Right_Hip,Right_Shoulder,RootJoint=
  73.         (not Set_Up_1.Motor6d_Enabled.Left_Leg and(function()local a=Torso:FindFirstChild'Left Hip';
  74.         if a then Remove(a)end;local b=Instance_2('Weld',{Part0=Torso;Part1=Left_Leg;Parent=Torso;});
  75.         return b;end)())or Torso:FindFirstChild'Left Hip',(not Set_Up_1.Motor6d_Enabled.Left_Arm
  76.         and(function()local a=Torso:FindFirstChild'Left Shoulder';if a then Remove(a)end;
  77.         local b=Instance_2('Weld',{Part0=Torso;Part1=Left_Arm;Parent=Torso;});return b;end)())or
  78.         Torso:FindFirstChild'Left Shoulder',Torso:FindFirstChild'Neck',(not Set_Up_1.Motor6d_Enabled.
  79.         Right_Leg and(function()local a=Torso:FindFirstChild'Right Hip';if a then Remove(a)end;
  80.         local b=Instance_2('Weld',{Part0=Torso;Part1=Right_Leg;Parent=Torso;});return b;end)())or
  81.         Torso:FindFirstChild'Right Hip',(not Set_Up_1.Motor6d_Enabled.Right_Arm and(function()
  82.         local a=Torso:FindFirstChild'Right Shoulder';if a then Remove(a)end;local b=Instance_2('Weld'
  83.         ,{Part0=Torso;Part1=Right_Arm;Parent=Torso;});return b;end)())or Torso:FindFirstChild
  84.         'Right Shoulder',HRootPart:FindFirstChild'RootJoint';
  85.     if not Left_Hip or not Left_Shoulder or not Neck or not Right_Hip or not Right_Shoulder or
  86.         not RootJoint then return;end;local Joints={Left_Hip;Left_Shoulder;Neck;Right_Hip;RootJoint;
  87.     Right_Shoulder};   
  88.     local CFrames,CFrame_Mode,Frames={
  89.         ['Right Arm']={Idle={C0=CFrame.new(1,.5,0,-4.37113883e-08,0,1,0,.99999994,0,-1,0,-
  90.         4.37113883e-08);C1=CFrame.new(.199999809,.999998927,.200000763,-4.37113883e-08,0,1,-
  91.         .642787457,.766044021,-2.80971335e-08,-.766044378,-.642787218,-3.34848664e-08);};Walking={C0=
  92.         CFrame.new(1,.5,0,-4.37113883e-08,0,1,0,.99999994,0,-1,0,-4.37113883e-08);C1=CFrame.new(
  93.         .400000066,.899999976,.100000009,-4.37113883e-08,0,1,-.965925813,.258818954,-4.22219593e-08,
  94.         -.258819014,-.965925634,-1.13133387e-08);};Walk_Step_F={C0=CFrame.new(1,.5,0,-4.37113883e-08,
  95.         0,1,0,.99999994,0,-1,0,-4.37113883e-08);C1=CFrame.new(.400000095,.904785037,-.0784164071,-
  96.         4.37113883e-08,0,1,-.98480773,-.173647895,-4.30473115e-08,.17364797,-.984807312,7.59039409e-09)
  97.         ;};Walk_Step_B={C0=CFrame.new(1,.5,0,-4.37113883e-08,0,1,0,.99999994,0,-1,0,-4.37113883e-08);C1
  98.         =CFrame.new(.400000095,.82026124,.259678245,-4.37113883e-08,0,1,-.76604408,.642787397,-
  99.         3.34848487e-08,-.642787933,-.766043603,-2.8097153e-08);};Jumpping={C0=CFrame.new(1,.5,0,-
  100.         4.37113883e-08,0,1,0,.99999994,0,-1,0,-4.37113883e-08);C1= CFrame.new(-.0307519436,.663428426,
  101.         .100000024,-.109381855,-.408217371,.906307697,-.234570041,-.875424922,-.42261824,.965925574,-
  102.         .258818984,4.22219486e-08);};
  103.        
  104.         };
  105.         ['Left Arm']={Idle={C0=CFrame.new(-1,.5,0,-4.37113883e-08,0,-1,0,.99999994,0,1,0,-
  106.         4.37113883e-08);C1=CFrame.new(-.199999988,1,.200000003,-4.37113883e-08,0,-1,.642787635,
  107.         .766044021,-2.80971406e-08,.766044378,-.642787158,-3.34848629e-08);};Walking={C0=CFrame.new(-
  108.         1,.5,0,-4.37113883e-08,0,-1,0,.99999994,0,1,0,-4.37113883e-08);C1=CFrame.new(-.399999976,
  109.         .900000036,.0999999791,-4.37113883e-08,0,-1,.965925813,.258818924,-4.22219593e-08,.258819014,-
  110.         .965925515,-1.13133387e-08)};Walk_Step_F={C0=CFrame.new(-1,.5,0,-4.37113883e-08,0,-1,0,
  111.         .99999994,0,1,0,-4.37113883e-08);C1=CFrame.new(-.399999976,.904784918,-.0784164667,-
  112.         4.37113883e-08,0,-1,.98480773,-.173647866,-4.30473115e-08,-.17364797,-.984807193,7.59039409e-09
  113.         );};Walk_Step_B={C0=CFrame.new(-1,.5,0,-4.37113883e-08,0,-1,0,.99999994,0,1,0,-4.37113883e-08);
  114.         C1= CFrame.new(-.399999976,.820261121,.259678125,-4.37113883e-08,0,-1,.76604408,.642787218,-
  115.         3.34848487e-08,.642787874,-.766043365,-2.80971495e-08);};Jumpping={C0=CFrame.new(-1,.5,0,-
  116.         4.37113883e-08,0,-1,0,.99999994,0,1,0,-4.37113883e-08);C1=CFrame.new(.0307520628,.663428366,
  117.         .100000232,-.109381832,.408217221,-.906307697,.234569982,-.875424564,-.42261824,-.965925574,-
  118.         .258818835,4.22219486e-08);};
  119.        
  120.         };
  121.         ['Right Leg']={Idle={C0=CFrame.new(1,-1,0,-4.37113883e-08,0,1,0,.99999994,0,-1,0,-
  122.         4.37113883e-08);C1=CFrame.new(.301519275,.659259915,.0670924783,-.467662066,-.171838373,
  123.         .867043018,-.779412746,-.382490724,-.496201962,.416902781,-.907838762,.0449434184);};Walking={
  124.         C0=CFrame.new(1,-1,0,-4.37113883e-08,0,1,0,.99999994,0,-1,0,-4.37113883e-08);C1=CFrame.new(
  125.         .5,.599999964,.200000003,-4.37113883e-08,0,1,-.965925813,.258818954,-4.22219593e-08,-
  126.         .258819014,-.965925634,-1.13133387e-08);};Walk_Step_F={C0=CFrame.new(1,-1,0,-4.37113883e-08,0,1,
  127.         0,.99999994,0,-1,0,-4.37113883e-08);C1=CFrame.new(.5,.692526817,.324746668,-4.37113883e-08,0,1,-
  128.         .996194661,-.0871553421,-4.35450502e-08,.0871553496,-.996194243,3.80968146e-09);};Walk_Step_B=
  129.         {C0=CFrame.new(1,-1,0,-4.37113883e-08,0,1,0,.99999994,0,-1,0,-4.37113883e-08);C1=CFrame.new(
  130.         .5,.552953005,.0122141838,-4.37113883e-08,0,1,-.76604408,.642787337,-3.34848487e-08,-
  131.         .642787814,-.766043603,-2.80971477e-08);};Jumpping={C0=CFrame.new(1,-1,0,-4.37113883e-08,0,1,0,
  132.         .99999994,0,-1,0,-4.37113883e-08);C1= CFrame.new(.448476374,.80779475,.0653932318,1.12914371e-08
  133.         ,.173647955,.98480773,3.15760758e-07,.984806478,-.173648179,-.999999821,2.53319655e-07,-
  134.         4.37113812e-08);};
  135.        
  136.         };
  137.         ['Left Leg']={Idle={C0=CFrame.new(-1,-1,0,-4.37113883e-08,0,-1,0,.99999994,0,1,0,-
  138.         4.37113883e-08);C1=CFrame.new(-.301519185,.659259558,.0670924783,-.467662066,.171838388,-
  139.         .867043078,.779412687,-.382490844,-.496201962,-.4169029,-.907838583,.0449434742);};Walking={C0=
  140.         CFrame.new(-1,-1,0,-4.37113883e-08,0,-1,0,.99999994,0,1,0,-4.37113883e-08);C1=CFrame.new(-
  141.         .5,.599999964,.200000003,-4.37113883e-08,0,-1,.965925813,.258818895,-4.22219593e-08,.258819014,
  142.         -.965925395,-1.13133387e-08);};Walk_Step_F={C0=CFrame.new(-1,-1,0,-4.37113883e-08,0,-1,0,
  143.         .99999994,0,1,0,-4.37113883e-08);C1= CFrame.new(-.5,.692527056,.32474649,-4.37113883e-08,0,-1,
  144.         .99619472,-.0871556029,-4.35450538e-08,-.0871556699,-.996193945,3.80969523e-09);};Walk_Step_B=
  145.         {C0=CFrame.new(-1,-1,0,-4.37113883e-08,0,-1,0,.99999994,0,1,0,-4.37113883e-08);C1=CFrame.new(-
  146.         .5,.552953362,.0122141838,-4.37113883e-08,0,-1,.766044378,.64278692,-3.34848629e-08,.642787695,
  147.         -.766043603,-2.80971424e-08);};Jumpping={C0=CFrame.new(-1,-1,0,-4.37113883e-08,0,-1,0,.99999994,
  148.         0,1,0,-4.37113883e-08);C1= CFrame.new(-.448476404,.807795107,.0653935894,-3.78721907e-08,-
  149.         .17364791,-.98480773,-3.69399586e-08,.98480624,-.173648179,1,-5.96046341e-08,-4.37113883e-08);};
  150.        
  151.         };
  152.         Head={Idle={C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,0);C1=CFrame.new(0,-.5,0,-1,0,0,0,.422618032,
  153.         .906307876,0,.906307876,-.422618032)};Walking={C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,0);C1=
  154.         CFrame.new(0,-.699999988,-.199999973,-1,0,0,0,.965925753,.258819073,0,.258819073,-.965925753);};
  155.         Jumpping={C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,0);C1=CFrame.new(0,-.699999988,-.199999973,-1,0,
  156.         0,0,.965925753,.258819073,0,.258819073,-.965925753);};
  157.        
  158.         };
  159.         Torso={Idle={C0=CFrame.new(0,0,0,-1,0,0,0,0,1,0,1,0);C1=CFrame.new(0,1.54072285,.718450546,-1,
  160.         0,0,0,-.422617853,.906307936,0,.906307936,.422617853)};Walking={C0=CFrame.new(0,0,0,-1,0,0,0,0,1
  161.         ,0,1,0);C1=CFrame.new(0,.0776481628,1.35229492,-.99999994,0,0,0,-.965925813,.258819014,0,
  162.         .258819014,.965925813)};Jumpping={C0=CFrame.new(0,0,0,-1,0,0,0,0,1,0,1,0);C1=CFrame.new(0,
  163.         .0776481628,1.35229492,-.99999994,0,0,0,-.965925813,.258819014,0,.258819014,.965925813);};
  164.         Climbing={C0=CFrame.new(0,0,0,-1,0,0,0,0,1,0,1,0);C1=CFrame.new(0,0,0,-.999999881,0,0,0,
  165.         .258819014,.965925753,0,.965925753,-.258819014);};
  166.         };},{['Right Arm']='Idle';['Left Arm']='Idle';['Right Leg']='Idle';['Left Leg']='Idle';Head=
  167.         'Idle';Torso='Idle';},{WalkFrame=0};
  168.    
  169.     local Change_Mode=function(t_1,mode)for _,a in pairs(t_1)do CFrame_Mode[a]=mode;end;end;
  170.     (function()--[[Appearence]]local a=pchar:FindFirstChildWhichIsA'Shirt'or Instance_2('Shirt',{
  171.         Parent=pchar;});if Set_Up_1.Shirt_Asset==true then elseif Set_Up_1.Shirt_Asset then
  172.         a.ShirtTemplate=Asset_Prefix..Set_Up_1.Shirt_Asset;else Remove(a);end;
  173.         local a=pchar:FindFirstChildWhichIsA'Pants'or Instance_2('Pants',{Parent=pchar;});
  174.         if Set_Up_1.Pants_Asset==true then elseif Set_Up_1.Pants_Asset then
  175.         a.Pants=Asset_Prefix..Set_Up_1.Pants_Asset;else Remove(a);end;
  176.         if #Set_Up_1.Customized_Face_Ids~=0 then for _,a in pairs(Head:GetChildren())do
  177.         if a:IsA'Decal'then Remove(a);end;end;for _,a in pairs(Set_Up_1.Customized_Face_Ids)do
  178.         local b=(typeof(a)=='table'and a)or{Color3=Color3.fromRGB(255,255,255);Transparency=0;Texture=
  179.         Asset_Prefix..tostring(a)};b.Parent=Head;b.Face='Front';Instance_2('Decal',b);end;end;
  180.         for a,b in pairs(Set_Up_1.Destroy_Accessories)do if b then
  181.         for _,c in pairs(pchar:GetChildren())do(function()if not c:IsA'Accessory'then return;end;
  182.         local d=c:FindFirstChildWhichIsA('Attachment',true);if not d then return;end;if a~=d.Name then
  183.         return;end;c:Destroy();end)();end;end;end;if Set_Up_1.Destroy_Character_Meshes then
  184.         for _,a in pairs(pchar:GetChildren())do if a:IsA'CharacterMesh'then Remove(a);end;end;end;
  185.     end)();
  186.     local function Animation(cfs,In_Action)for _,c in pairs(Joints)do for a,b in pairs(cfs)do
  187.         if c.Part1.Name==a then for d,e in pairs(b)do if In_Action[a]==d then
  188.         c.C0,c.C1=clerp(c.C0,e.C0,e[3]or.5),clerp(c.C1,e.C1,e[3]or.5);end;end;break;end;end;end;end;
  189.     local function ServerHandler(pl,...)local args={...};end;local function Movement_Mode(arg1)
  190.     if arg1=='Walking'then local a=Frames.WalkFrame%20;
  191.     if a==0 or a==10 then Change_Mode({'Left Arm';'Torso';'Head';'Right Arm';'Left Leg';'Right Leg';},'Walking');
  192.     elseif a==5 then Change_Mode({'Left Arm';'Left Leg';},'Walk_Step_B');
  193.     Change_Mode({'Right Arm';'Right Leg';},'Walk_Step_F');elseif a==15 then
  194.     Change_Mode({'Left Arm';'Left Leg';},'Walk_Step_F');Change_Mode({'Right Arm';'Right Leg';},'Walk_Step_B');
  195.     end;elseif arg1=='Idle'or arg1=='Sitting'then
  196.     Change_Mode({'Left Arm';'Torso';'Head';'Right Arm';'Left Leg';'Right Leg';},'Idle');
  197.     elseif arg1=='Jumpping'or arg1=='Falling'then
  198.     Change_Mode({'Left Arm';'Torso';'Head';'Right Arm';'Left Leg';'Right Leg';},'Jumpping');
  199.     elseif arg1=='Idle_Climb'then
  200.     Change_Mode({'Left Arm';'Head';'Right Arm';'Left Leg';'Right Leg';},
  201.         'Walking');Change_Mode({'Torso'},'Climbing');elseif arg1=='Moving_Climb'then local a=Frames.WalkFrame%20;
  202.     if a==0 or a==10 then Change_Mode({'Left Arm';'Head';'Right Arm';'Left Leg';'Right Leg';},'Walking');
  203.     elseif a==5 then Change_Mode({'Left Arm';'Left Leg';},'Walk_Step_B');
  204.     Change_Mode({'Right Arm';'Right Leg';},'Walk_Step_F');elseif a==15 then
  205.     Change_Mode({'Left Arm';'Left Leg';},'Walk_Step_F');Change_Mode({'Right Arm';'Right Leg';},'Walk_Step_B');
  206.     end;end;end;
  207.     Humanoid.MaxHealth=Set_Up_1.Health or 100;Humanoid.WalkSpeed=Set_Up_1.WalkSpeed or 16;
  208.     Humanoid.JumpPower=Set_Up_1.JumpPower or 50;Humanoid.Health=Humanoid.MaxHealth;cwrap(function()
  209.     while true do wait();Animation(CFrames,CFrame_Mode);end;end);cwrap(function()while true do
  210.     local velo=Torso.Velocity;for a in pairs(Frames)do Frames[a]=Frames[a]+1;end;local HState=Humanoid:GetState();
  211.     Movement_Mode((Humanoid.Sit==true and'Sitting')or(velo.Y>Set_Up_1.Movement_Range and Humanoid.
  212.     FloorMaterial==Enum.Material.Air and HState~=Enum.HumanoidStateType.Climbing and'Jumpping')or(velo.Y<-
  213.         Set_Up_1.Movement_Range and Humanoid.FloorMaterial==Enum.Material.Air and HState~=
  214.         Enum.HumanoidStateType.Climbing and'Falling')or((velo.X>Set_Up_1.Movement_Range or velo.X<-
  215.         Set_Up_1.Movement_Range or velo.Z>Set_Up_1.Movement_Range or velo.Z<-Set_Up_1.Movement_Range)and'Walking')
  216.         or(HState==Enum.HumanoidStateType.Climbing and not(velo.Y>Set_Up_1.Movement_Range or velo.Y<-
  217.         Set_Up_1.Movement_Range)and'Idle_Climb')or(HState==Enum.HumanoidStateType.Climbing and(velo.Y>
  218.         Set_Up_1.Movement_Range or velo.Y<-Set_Up_1.Movement_Range)and'Moving_Climb')or'Idle');wait();end;end);
  219.     RE.OnServerEvent:Connect(ServerHandler);RF.OnServerInvoke=ServerHandler;
  220. end;
  221. Set_Up_Function'FindPlayer';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement