Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait();
- rst = game:GetService("RunService").RenderStepped;
- local asin = math.asin;
- local atan2 = math.atan2;
- local rad = math.rad;
- local abs = math.abs;
- local deg = math.deg
- local player = game.Players.LocalPlayer;
- local Mouse = player:GetMouse();
- local Camera = Workspace.CurrentCamera;
- local char = player.Character;
- local human = char.Humanoid;
- --animate = char:WaitForChild("Animate");
- --animate.Disabled = true;
- --wait(1);
- --animate:Destroy();
- wait(1);
- local torso = char.Torso;
- local model = char;
- local human = char.Humanoid;
- local Neck = torso.Neck;
- local head = char.Head;
- local ls = torso["Left Shoulder"];
- local rs = torso["Right Shoulder"];
- local lh = torso["Left Hip"];
- local rh = torso["Right Hip"];
- local hrp = char["HumanoidRootPart"]["RootJoint"];
- local la = char["Left Arm"];
- local ra = char["Right Arm"];
- hrp.C0 = CFrame.new(0, 0, 0, 1, 1.68453017e-022, -4.14363114e-024, -1.68453017e-022, 1, 1.72377808e-022, 4.14363114e-024, -1.72377808e-022, 1)
- hrp.C1 = CFrame.new(0, 0, 0, 1, 1.68453017e-022, -4.14363114e-024, -1.68453017e-022, 1, 1.72377808e-022, 4.14363114e-024, -1.72377808e-022, 1)
- ls.C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-008, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-008);
- ls.C1 = CFrame.new(0.5, 0.5, 0, -4.37113883e-008, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-008);
- rs.C0 = CFrame.new(1, 0.5, 0, -4.37113883e-008, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-008);
- rs.C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-008, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-008);
- lh.C0 = CFrame.new(-1, -1, 0, -4.37113883e-008, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-008);
- lh.C1 = CFrame.new(-0.5, 1, 0, -4.37113883e-008, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-008);
- rh.C0 = CFrame.new(1, -1, 0, -4.37113883e-008, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-008);
- rh.C1 = CFrame.new(0.5, 1, 0, -4.37113883e-008, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-008);
- Neck.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0);
- Neck.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- rhc0 = rh.C0;
- lhc0 = lh.C0;
- local lsc0 = ls.C0;
- local rsc0 = rs.C0;
- local MovingNeck = false;
- local ForceLeft = false;
- local ForceRight = false;
- local LockedArms = false;
- local ForceLightning = false;
- local WalkSpeed = 10;
- local fre = 8;
- local hrpc0 = hrp.C0;
- local rootpart = hrp.Parent;
- LockedArms = false;
- MovingNeck = false;
- CtrlDown = 0;
- function clamp(v,mi,ma)
- if v<mi then return mi elseif v>ma then return ma else return v end
- end
- locked = false;
- function rec(p,b)
- for _,v in pairs(p:GetChildren()) do
- if v:isA("BasePart") then
- v.CanCollide = b;
- else
- rec(v,b);
- end
- end
- end
- Collide = true;
- situps = false;
- Mouse.KeyDown:connect(function(k)
- if k == "y" then
- CtrlDown = CtrlDown == 0 and 1 or 0;
- end
- if k == "k" then
- situps = not situps;
- if situps then
- rootpart.Anchored = true;
- local orig = rootpart.CFrame;
- local cf = CFrame.new(orig.X,1,orig.Z);
- rootpart.CFrame = CFrame.new(cf.p,cf.p+Vector3.new(0,10,0));
- else
- local orig = rootpart.CFrame;
- local cf = CFrame.new(orig.X,5,orig.Z);
- rootpart.CFrame = cf;
- rootpart.Anchored = false;
- end
- end
- if k == "x" then
- Collide = not Collide;
- rec(char,Collide);
- print("CanCollide: ",Collide);
- end
- if k == "t" then
- locked = not locked;
- if not locked then
- lockedhrp = nil;
- lockedrh = nil;
- lockedlh = nil;
- else
- lockedhrp = hrp.C0;
- lockedlh = lh.C0;
- lockedrh = rh.C0;
- end
- end
- if k == "q" then
- ForceLeft = true;
- end
- if k == "e" then
- ForceRight = true;
- end
- if k == "v" then
- LockedArms = not LockedArms; print("Locked arms: ",LockedArms);
- end
- if k == "r" then
- MovingNeck = not MovingNeck;
- end
- if k == "\48" and (not ForceRight and not ForceLeft) then
- WalkSpeed = 18;
- fre = 12;
- end
- end)
- Mouse.KeyUp:connect(function(k)
- if k == "\48" then
- WalkSpeed = 10;
- fre = 8;
- end
- if k == "q" then
- ForceLeft = false;
- end
- if k == "e" then
- ForceRight = false;
- end
- end)
- while true do
- time = Workspace.DistributedGameTime;
- if torso.Velocity.magnitude > 1 and not lockls and not lockrs then
- local sin = math.sin(time*fre);
- local desangle = 1.1 * sin;
- lh.MaxVelocity = 1;
- rh.DesiredAngle = desangle
- rs.DesiredAngle = RightStationary and desangle or 0;
- lh.DesiredAngle = desangle;
- ls.DesiredAngle = LeftStationary and desangle or 0;
- else
- rh.DesiredAngle = 0;
- rs.DesiredAngle = 0;
- lh.DesiredAngle = 0;
- ls.DesiredAngle = 0;
- end
- local MouseY = Mouse.Y;
- local MouseX = Mouse.X;
- local d = torso.CFrame:pointToObjectSpace(Mouse.UnitRay.Origin+Mouse.UnitRay.Direction.unit*1000);
- mouseX = atan2(d.X,-d.Z)*2
- mouseY = asin(-d.unit.Y)*2
- mouseYn = asin(((MouseY/Mouse.ViewSizeY)-0.5)*2);
- if (not (Mouse.Y <= 3 or Mouse.X >= Mouse.ViewSizeX - 5 or Mouse.X <= 3 or Mouse.Y >= Mouse.ViewSizeY - 5)) then
- local CamY = clamp(Camera.CoordinateFrame.lookVector.Y,-1,0)*2;
- AngleY = clamp(-mouseY,-2.3,3.05); --1.3,2.05
- AngleYn = clamp(-mouseYn,-2.3,3.05);
- AngleX = clamp(-mouseX,-1.5,1.5);
- AngleYArm = AngleY-CamY;
- local ArmX = clamp(AngleX,-1.5,0.75);
- local ArmY = AngleYArm+(1.25+AngleYArm)
- local TorsoY = clamp(AngleYn*2,-2,2);
- local HeadY = clamp((AngleY-CamY)*2,-0.75,0.8);
- if CtrlDown >0 then
- hrp.C0 = lockedhrp or
- CFrame.new(0,-(math.abs(TorsoY)/2)*1.25,-(math.abs(TorsoY)/2)*.5)*CFrame.Angles((CtrlDown)*TorsoY,0,0)
- lh.C0 = lockedlh or lhc0*CFrame.Angles(0,0,CtrlDown*TorsoY)
- rh.C0 = lockedrh or rhc0*CFrame.Angles(0,0,CtrlDown*-TorsoY)
- else
- hrp.C0 = lockedhrp or hrpc0; lh.C0 = lhc0; rh.C0 = rhc0;
- end
- if MovingNeck then
- Neck.C0=CFrame.new(0,1,0)*CFrame.Angles(HeadY,AngleX,0)*CFrame.new(0,0.5,0)
- Neck.C1 = CFrame.new();
- end
- if ForceLeft then
- LeftStationary = false;
- ls.C0 = lsc0*CFrame.Angles(-rad(15),ArmX,-ArmY);
- elseif not LeftStationary then
- LeftStationary = true;
- ls.C0=lsc0;
- end
- if ForceRight then
- RightStationary = false;
- rs.C0 = rsc0*CFrame.Angles(-rad(15),ArmX,ArmY);
- elseif not RightStationary then
- RightStationary = true;
- rs.C0=rsc0;
- end
- end
- rst:wait();
- end
Advertisement
Add Comment
Please, Sign In to add comment