Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ By: Brutez. ]]--
- local AnimationScript=script;
- repeat Wait(0);until script and script.ClassName=="Script"and script.Parent and script.Parent.ClassName=="Model"and script.Parent:FindFirstChild("Torso")and script.Parent:FindFirstChild("Head");
- local SCP096=AnimationScript.Parent;
- local SCP096Torso=SCP096:FindFirstChild("Torso");
- local LeftHip=SCP096Torso:FindFirstChild("Left Hip");
- local LeftShoulder=SCP096Torso:FindFirstChild("Left Shoulder");
- local Neck=SCP096Torso:FindFirstChild("Neck");
- local RightHip=SCP096Torso:FindFirstChild("Right Hip");
- local RightShoulder=SCP096Torso:FindFirstChild("Right Shoulder");
- local SCP096Humanoid;
- for _,Child in pairs(SCP096:GetChildren())do
- if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
- SCP096Humanoid=Child;
- end;
- end;
- local CurrentPose="WhaaPose";
- local CurrentToolAnimation="None";
- local CurrentToolAnimationTime=0;
- function AquireTool()
- for _,Child in ipairs(SCP096:GetChildren()) do
- if Child and Child~=nil and Child.className=="Tool"then
- return Child;
- end;
- end;
- end;
- function AquireToolAnimation(ToolChild)
- for _,Child in ipairs(ToolChild:GetChildren()) do
- if Child and Child~=nil and Child.Name=="toolanim"and Child.className=="StringValue"then
- return Child;
- end;
- end;
- end;
- function ToolAnimation()
- if CurrentToolAnimation=="None"then
- RightShoulder.DesiredAngle=1.57;
- return;
- elseif CurrentToolAnimation=="Slash"then
- RightShoulder.MaxVelocity=0.5;
- RightShoulder.DesiredAngle=0;
- return;
- elseif CurrentToolAnimation=="Lunge"then
- RightShoulder.MaxVelocity=0.5;
- LeftShoulder.MaxVelocity=0.5;
- RightHip.MaxVelocity=0.5;
- LeftHip.MaxVelocity=0.5;
- RightShoulder.DesiredAngle=1.57;
- LeftShoulder.DesiredAngle=1.0;
- RightHip.DesiredAngle=1.57;
- LeftHip.DesiredAngle=1.0;
- return;
- end;
- end;
- function ChangeAngle(time)
- local Amount;
- local Rate;
- local Angle;
- if CurrentPose=="Jumping"then
- LeftHip.MaxVelocity=0.5;
- LeftHip.DesiredAngle=0;
- LeftShoulder.CurrentAngle=-3.14;
- LeftShoulder.DesiredAngle=-3.14;
- Neck.MaxVelocity=5;
- Neck.DesiredAngle=0;
- RightHip.MaxVelocity=0.5;
- RightHip.DesiredAngle=0;
- RightShoulder.CurrentAngle=3.14;
- RightShoulder.MaxVelocity=0.5;
- RightShoulder.DesiredAngle=3.14;
- Amount=nil;
- Rate=nil;
- Angle=nil;
- elseif CurrentPose=="FreeFall"then
- LeftHip.MaxVelocity=0.5;
- LeftHip.DesiredAngle=0;
- LeftShoulder.MaxVelocity=0.5;
- LeftShoulder.DesiredAngle=-3.14;
- Neck.MaxVelocity=5;
- Neck.DesiredAngle=0;
- RightHip.MaxVelocity=0.5;
- RightHip.DesiredAngle=0;
- RightShoulder.MaxVelocity=0.5;
- RightShoulder.DesiredAngle=3.14;
- Amount=nil;
- Rate=nil;
- Angle=nil;
- elseif CurrentPose=="Sitting"then
- LeftHip.MaxVelocity=0.15;
- LeftHip.DesiredAngle=-3.14/2;
- LeftShoulder.MaxVelocity=0.15;
- LeftShoulder.DesiredAngle=-3.14/2;
- Neck.MaxVelocity=0.15;
- Neck.DesiredAngle=0;
- RightHip.MaxVelocity=0.15;
- RightHip.DesiredAngle=3.14/2;
- RightShoulder.MaxVelocity=0.15;
- RightShoulder.DesiredAngle=3.14/2;
- Amount=nil;
- Rate=nil;
- Angle=nil;
- elseif CurrentPose=="Walking"then
- LeftHip.MaxVelocity=0.2;
- LeftShoulder.MaxVelocity=0.2;
- Neck.MaxVelocity=0.02;
- RightHip.MaxVelocity=0.2;
- RightShoulder.MaxVelocity=0.2;
- Amount=0.4;
- Rate=2;
- Angle=0;
- elseif CurrentPose=="Running"then
- if script.CanSee.Value then
- LeftHip.MaxVelocity=0.4;
- LeftShoulder.MaxVelocity=0.4;
- LeftShoulder.DesiredAngle=-3.14/2;
- Neck.MaxVelocity=1;
- RightHip.MaxVelocity=0.4;
- RightShoulder.MaxVelocity=0.4;
- RightShoulder.DesiredAngle=3.14/2;
- Amount=2;
- Rate=15;
- Angle=0;
- elseif not script.CanSee.Value then
- LeftHip.MaxVelocity=0.4;
- LeftShoulder.MaxVelocity=0.4;
- LeftShoulder.DesiredAngle=3.14/2;
- Neck.MaxVelocity=1;
- RightHip.MaxVelocity=0.4;
- RightShoulder.MaxVelocity=0.4;
- RightShoulder.DesiredAngle=-3.14/2;
- Amount=2;
- Rate=15;
- Angle=0;
- end;
- elseif CurrentPose=="Panic"then
- LeftHip.DesiredAngle=0;
- LeftHip.MaxVelocity=1;
- LeftShoulder.DesiredAngle=-3.14;
- LeftShoulder.MaxVelocity=1;
- Neck.DesiredAngle=0;
- Neck.MaxVelocity=0.3;
- RightHip.DesiredAngle=0;
- RightHip.MaxVelocity=1;
- RightShoulder.MaxVelocity=1;
- RightShoulder.DesiredAngle=3.14;
- Amount=1;
- Rate=10;
- Angle=0;
- elseif CurrentPose=="Climbing"then
- LeftHip.MaxVelocity=0.7;
- LeftShoulder.MaxVelocity=0.15;
- Neck.MaxVelocity=1;
- RightHip.MaxVelocity=0.7;
- RightShoulder.MaxVelocity=0.15;
- Amount=1;
- Rate=9;
- Angle=3.14;
- elseif CurrentPose=="Platformed"then
- LeftHip.DesiredAngle=0;
- LeftHip.CurrentAngle=0;
- LeftHip.MaxVelocity=0;
- LeftShoulder.DesiredAngle=0;
- LeftShoulder.CurrentAngle=0;
- LeftShoulder.MaxVelocity=0;
- Neck.DesiredAngle=0;
- Neck.CurrentAngle=0;
- Neck.MaxVelocity=0;
- RightHip.DesiredAngle=0;
- RightHip.CurrentAngle=0;
- RightHip.MaxVelocity=0;
- RightShoulder.MaxVelocity=0;
- RightShoulder.DesiredAngle=0;
- RightShoulder.CurrentAngle=0;
- Amount=nil;
- Rate=nil;
- Angle=nil;
- elseif CurrentPose=="WhaaPose"then
- LeftHip.MaxVelocity=0.05;
- LeftShoulder.MaxVelocity=0.05;
- Neck.MaxVelocity=0.005;
- RightHip.MaxVelocity=0.05;
- RightShoulder.MaxVelocity=0.05;
- Amount=0.1;
- Rate=3;
- Angle=0;
- end;
- if CurrentPose~="Platformed"or CurrentPose~="Jumping"or CurrentPose~="FreeFalling"or CurrentPose~="Sitting"then
- if Amount and Amount~=nil and Rate and Rate~=nil and Angle and Angle~=nil then
- local DesiredAngle=Amount*math.sin(time*Rate);
- if CurrentPose~="Running"then
- Neck.DesiredAngle=DesiredAngle;
- end;
- if CurrentPose~="Running"and CurrentPose~="Panic"then
- RightShoulder.DesiredAngle=DesiredAngle+Angle;
- LeftShoulder.DesiredAngle=DesiredAngle-Angle;
- end;
- if CurrentPose~="Panic"then
- RightHip.DesiredAngle=-DesiredAngle;
- LeftHip.DesiredAngle=-DesiredAngle;
- end;
- end;
- local CurrentTool=AquireTool();
- if CurrentTool and CurrentTool~=nil then
- local animStringValueObject=AquireToolAnimation(CurrentTool);
- if animStringValueObject then
- CurrentToolAnimation=animStringValueObject.Value;
- animStringValueObject.Parent=nil;
- CurrentToolAnimationTime=time+0.3;
- end;
- if time>CurrentToolAnimationTime then
- CurrentToolAnimationTime=0
- CurrentToolAnimation="None"
- end;
- ToolAnimation();
- else
- CurrentToolAnimation="None";
- CurrentToolAnimationTime=0;
- end;
- end;
- end;
- Spawn(function()
- while Wait(0)do
- if AnimationScript and SCP096 and SCP096Torso and SCP096Torso~=nil then
- local FiredRay=Ray.new(SCP096Torso.Position,Vector3.new(0,-5.5,0));
- local RayTarget,endPoint=Game:GetService("Workspace"):FindPartOnRay(FiredRay,SCP096);
- if RayTarget and(SCP096Torso.Velocity-Vector3.new(0,SCP096Torso.Velocity.y,0)).magnitude>=5 and SCP096Humanoid and SCP096Humanoid.WalkSpeed==10 and not SCP096Humanoid.Sit and not SCP096Humanoid.PlatformStand then
- CurrentPose="Walking";
- elseif RayTarget and(SCP096Torso.Velocity-Vector3.new(0,SCP096Torso.Velocity.y,0)).magnitude>=5 and SCP096Humanoid and SCP096Humanoid.WalkSpeed==50 and not SCP096Humanoid.Sit and not SCP096Humanoid.PlatformStand then
- CurrentPose="Running";
- elseif SCP096Humanoid and SCP096Humanoid.Sit and not SCP096Humanoid.PlatformStand then
- CurrentPose="Sitting";
- elseif not RayTarget and SCP096Humanoid and not SCP096Humanoid.Sit and not SCP096Humanoid.PlatformStand then
- CurrentPose="Jumping";
- elseif SCP096Humanoid and SCP096Humanoid.PlatformStand then
- CurrentPose="Platformed";
- elseif RayTarget and(SCP096Torso.Velocity-Vector3.new(0,SCP096Torso.Velocity.y,0)).magnitude<=5 and SCP096Humanoid and SCP096Humanoid.WalkSpeed==0 and not SCP096Humanoid.Sit and not SCP096Humanoid.PlatformStand then
- CurrentPose="Panic";
- else
- CurrentPose="WhaaPose";
- end;
- end;
- end;
- end);
- while Wait(0)do
- if Game~=nil and Game:GetService("Workspace")~=nil and not Game:GetService("Workspace"):FindFirstChild("BrutezCredit")then
- local BrutezCredit=Instance.new("Hint",Game:GetService("Workspace"));
- BrutezCredit.Name="BrutezCredit";
- BrutezCredit.Text="The creator of this game wants to thank Brutez for his SCP-096 script! Kudos!";
- BrutezCredit.Archivable=false;
- end
- if SCP096 then
- local _,time=Wait(0);
- ChangeAngle(time);
- else
- break;
- end;
- end;
- --[[ By: Brutez. ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement