Advertisement
Rufus14

my new animations

Jul 14th, 2019
2,441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.92 KB | None | 0 0
  1. --By Rufus14
  2. NLS([[
  3. --By Rufus14
  4. owner = game:GetService("Players").LocalPlayer
  5. owner.Character:WaitForChild("Head")
  6. mouse = owner:GetMouse()
  7. local remote = owner.Character:WaitForChild("lookremote")
  8. local part = Instance.new("Part", owner.Character.Head)
  9. part.Size = Vector3.new(0.1,0.1,0.1)
  10. part.Transparency = 1
  11. part.CanCollide = false
  12. part.Name = "camera"
  13. part:BreakJoints()
  14. local weld = Instance.new("Weld", part)
  15. weld.Part0 = owner.Character.Head
  16. weld.Part1 = part
  17. weld.C0 = CFrame.new(0,0,-1)
  18. cangoup = true
  19. rolling = false
  20. function sprinton(key)
  21.     key = key:lower()
  22.     if key:byte() == 48 then
  23.         owner.Character:findFirstChildOfClass("Humanoid").WalkSpeed = 30
  24.     end
  25. end
  26. function sprintoff(key)
  27.     key = key:lower()
  28.     if key:byte() == 48 then
  29.         owner.Character:findFirstChildOfClass("Humanoid").WalkSpeed = 16
  30.     end
  31. end
  32. mouse.KeyUp:connect(sprintoff)
  33. mouse.KeyDown:connect(sprinton)
  34. while game:GetService("RunService").RenderStepped:wait() do
  35.     remote:FireServer(mouse.Hit.p, mouse.Origin.p, workspace.CurrentCamera.CFrame)
  36.     if (workspace.CurrentCamera.CFrame.p - part.Position).magnitude <= 1.7 then
  37.         game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position,Vector3.new(mouse.Hit.p.x,game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position.y,mouse.Hit.p.z))
  38.         workspace.CurrentCamera.FieldOfView = 100
  39.         for i,v in pairs(owner.Character:GetChildren()) do
  40.             if v.ClassName == "Part" or v.ClassName == "MeshPart" and v.Name ~= "Head" then
  41.                 v.LocalTransparencyModifier = 0
  42.             end
  43.             if v.ClassName == "Accessory" then
  44.                 v.Handle.Transparency = 1
  45.             end
  46.         end
  47.         if owner.Character.Head:findFirstChildOfClass("Decal") then
  48.             owner.Character.Head:findFirstChildOfClass("Decal").Transparency = 1
  49.         end
  50.         owner.Character.Head.Transparency = 1
  51.         workspace.CurrentCamera.CameraSubject = part
  52.     else
  53.         for i,v in pairs(owner.Character:GetChildren()) do
  54.             if v.ClassName == "Accessory" then
  55.                 v.Handle.Transparency = 0
  56.             end
  57.         end
  58.         workspace.CurrentCamera.FieldOfView = 70
  59.         owner.Character.Head.Transparency = 0
  60.         if owner.Character.Head:findFirstChildOfClass("Decal") then
  61.             owner.Character.Head:findFirstChildOfClass("Decal").Transparency = 0
  62.         end
  63.         workspace.CurrentCamera.CameraSubject = owner.Character
  64.     end
  65. end
  66. ]], owner.Character)
  67. step = game:GetService("RunService").Stepped
  68. local leftarm = Instance.new("Weld", owner.Character.Torso)
  69. leftarm.Part0 = owner.Character.Torso
  70. leftarm.Part1 = owner.Character["Left Arm"]
  71. leftarm.C0 = CFrame.new(-1.5,-0.5,0)
  72. leftarm.C1 = CFrame.new(0,0.5,0)
  73. leftarm.Name = "LeftArmWeld"
  74. local rightarm = Instance.new("Weld", owner.Character.Torso)
  75. rightarm.Part0 = owner.Character.Torso
  76. rightarm.Part1 = owner.Character["Right Arm"]
  77. rightarm.C0 = CFrame.new(1.5,0.5,0)
  78. rightarm.C1 = CFrame.new(0,0.5,0)
  79. rightarm.Name = "RightArmWeld"
  80. local rightleg = Instance.new("Weld", owner.Character.Torso)
  81. rightleg.Part0 = owner.Character.Torso
  82. rightleg.Part1 = owner.Character["Right Leg"]
  83. rightleg.C0 = CFrame.new(0.5,-2,0)
  84. rightleg.C1 = CFrame.new(0,1,0)
  85. rightleg.Name = "RightLegWeld"
  86. local leftleg = Instance.new("Weld", owner.Character.Torso)
  87. leftleg.Part0 = owner.Character.Torso
  88. leftleg.Part1 = owner.Character["Left Leg"]
  89. leftleg.C0 = CFrame.new(-0.5,-2,0)
  90. leftleg.C1 = CFrame.new(0,1,0)
  91. leftleg.Name = "LeftLegWeld"
  92. local head = Instance.new("Weld", owner.Character.Torso)
  93. head.Part0 = owner.Character.Torso
  94. head.Part1 = owner.Character.Head
  95. head.C0 = CFrame.new(0,1.5,0)
  96. head.C1 = CFrame.new(0,-0.1,0)
  97. head.Name = "HeadWeld"
  98. local humanoidrootpart = Instance.new("Weld", owner.Character.HumanoidRootPart)
  99. humanoidrootpart.Part0 = owner.Character.HumanoidRootPart
  100. humanoidrootpart.Part1 = owner.Character.Torso
  101. humanoidrootpart.Name = "HumanoidRootPartWeld"
  102. sine = 0
  103. change = 1
  104. anim = "stand"
  105. rootpart = owner.Character.HumanoidRootPart
  106. walksound = Instance.new("Sound", owner.Character.Head)
  107. walksound.SoundId = "rbxassetid://1244506786"
  108. walksound.Looped = true
  109. walksound:Play()
  110. walksound.Volume = 0
  111. walksound.MaxDistance = 20
  112. jumpsound = Instance.new("Sound", owner.Character.Head)
  113. jumpsound.SoundId = "rbxassetid://158149887"
  114. jumpsound.Volume = 0.3
  115. jumpsound.MaxDistance = 20
  116. fallsound = Instance.new("Sound", owner.Character.Head)
  117. fallsound.SoundId = "rbxassetid://866649671"
  118. fallsound.Looped = true
  119. fallsound:Play()
  120. fallsound.Volume = 0
  121. fallsound.MaxDistance = 20
  122. fallbigsound = Instance.new("Sound", owner.Character.Head)
  123. fallbigsound.SoundId = "rbxassetid://535681058"
  124. fallbigsound.Volume = 1
  125. fallbigsound.MaxDistance = 30
  126. humanoid = owner.Character:findFirstChildOfClass("Humanoid")
  127. cananimate = true
  128. alreadyjumped = false
  129. falling = false
  130. function checkrun()
  131.     while step:wait() do
  132.         if owner.Character.HumanoidRootPart.Velocity.x <= -17 or owner.Character.HumanoidRootPart.Velocity.x >= 17 or owner.Character.HumanoidRootPart.Velocity.z <= -17 or owner.Character.HumanoidRootPart.Velocity.z >= 17 and humanoid.FloorMaterial ~= Enum.Material.Air then
  133.             anim = "run"
  134.             walksound.PlaybackSpeed = 1.9
  135.             walksound.Volume = 0.8
  136.         elseif rootpart.Velocity.x >= -9 or rootpart.Velocity.x <= 9 or rootpart.Velocity.z >= -9 or rootpart.Velocity.z <= 9 and humanoid.FloorMaterial ~= Enum.Material.Air then
  137.             if rootpart.Velocity.z ~= 0 and rootpart.Velocity.x ~= 0 and humanoid.FloorMaterial ~= Enum.Material.Air then
  138.                 anim = "walk"
  139.                 walksound.PlaybackSpeed = 1.2
  140.                 walksound.Volume = 0.4
  141.             else
  142.                 anim = "stand"
  143.                 walksound.Volume = 0
  144.             end
  145.         end
  146.         if humanoid.FloorMaterial == Enum.Material.Air then
  147.             cananimate = false
  148.             walksound.Volume = 0
  149.             if rootpart.Velocity.y > 0 then
  150.                 if not alreadyjumped then
  151.                     alreadyjumped = true
  152.                     jumpsound.TimePosition = 0.05
  153.                     jumpsound:Play()
  154.                 end
  155.                 local function a()
  156.                     for i = 0,0.6 , 0.07 do
  157.                         if not cananimate then
  158.                             humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.Angles(0.3,0,0),i)
  159.                             head.C0 = head.C0:lerp(CFrame.Angles(0.1,0,0) * CFrame.new(0,1.4,0),i)
  160.                             leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(-0.1,0,0),i)
  161.                             rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(-0.1,0,0),i)
  162.                             leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1,0),i)
  163.                             rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1,0),i)
  164.                             step:wait()
  165.                         end
  166.                     end
  167.                 end
  168.                 spawn(a)
  169.             elseif rootpart.Velocity.y < 0 then
  170.                 falling = true
  171.                 local function a()
  172.                     for i = 0,1 , 0.05 do
  173.                         if not cananimate then
  174.                             humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.Angles(-0.3,0,0),i)
  175.                             head.C0 = head.C0:lerp(CFrame.fromEulerAnglesXYZ(-0.3,0,0) * CFrame.new(0,1.4,0),i)
  176.                             leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(0,0,-1),i)
  177.                             rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(0,0,1),i)
  178.                             leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-0.5,-0.5),i)
  179.                             rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-0.5,-0.5),i)
  180.                             step:wait()
  181.                         end
  182.                     end
  183.                 end
  184.                 local function b()
  185.                     fallsound.Volume = 0
  186.                     while step:wait() and falling do
  187.                         fallsound.Volume = fallsound.Volume + 0.025
  188.                     end
  189.                     falling = false
  190.                     fallsound.Volume = 0
  191.                 end
  192.                 spawn(a)
  193.                 spawn(b)
  194.             end
  195.         elseif humanoid.FloorMaterial ~= Enum.Material.Air then
  196.             cananimate = true
  197.         end
  198.     end
  199. end
  200. spawn(checkrun)
  201. local remote = Instance.new("RemoteEvent", owner.Character)
  202. remote.Name = "lookremote"
  203. local headd = Instance.new("Weld", owner.Character.Torso)
  204. headd.Part0 = owner.Character.Torso
  205. headd.Part1 = owner.Character.Head
  206. headd.C0 = CFrame.new(0,1,0)
  207. headd.Name = "HeaddWeld"
  208. function look(plr, where, origin, cameracf)
  209.     if plr == owner then
  210.         local lookvector = owner.Character.Torso.CFrame:toObjectSpace(cameracf).lookVector.unit
  211.         headd.C0 = CFrame.new(0,1,0) * CFrame.Angles(lookvector.y,0,0)
  212.         headd.C0 = headd.C0 * CFrame.Angles(0,-lookvector.x,0)
  213.         headd.C0 = headd.C0 * CFrame.new(0,0.5,0)
  214.     end
  215. end
  216. remote.OnServerEvent:connect(look)
  217. while step:wait() do
  218.     sine = sine + change
  219.     if anim == "stand" and cananimate then
  220.         alreadyjumped = false
  221.         if falling then
  222.             falling = false
  223.             fallbigsound:Play()
  224.         end
  225.         fallsound.Volume = 0
  226.         humanoidrootpart.C0 = CFrame.new(0,math.sin(sine/65)/20,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  227.         leftarm.C0 = CFrame.new(-1.5,math.sin(sine/65)/12 + 0.5,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(7))
  228.         rightarm.C0 = CFrame.new(1.5,math.sin(sine/65)/12 + 0.5,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(-7))
  229.         leftleg.C0 = CFrame.new(-0.5,-math.sin(sine/65)/20 - 1,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  230.         rightleg.C0 = CFrame.new(0.5,-math.sin(sine/65)/20 - 1,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  231.         head.C0 = CFrame.new(0,1.4,0) * CFrame.Angles(math.rad(5 * math.sin(sine/65))-0.1,math.rad(0),math.rad(0))
  232.     elseif anim == "run" and cananimate then
  233.         alreadyjumped = false
  234.         if falling then
  235.             falling = false
  236.             fallbigsound:Play()
  237.         end
  238.         fallsound.Volume = 0.35
  239.         humanoidrootpart.C0 = CFrame.new(0,1*math.cos(sine/2.5)/10,0) * CFrame.Angles(math.rad(4*math.cos(sine/4))+math.rad(-20),math.rad(0),math.rad(1*math.cos(sine/5)))
  240.         leftarm.C0 = CFrame.new(-1.5,0.5,-math.cos(sine/5)/4) * CFrame.Angles(0.2 + math.rad(80 * math.cos(sine/5)),math.rad(0),math.rad(12*math.cos(sine/5)))
  241.         rightarm.C0 = CFrame.new(1.5,0.5,math.cos(sine/5)/4) * CFrame.Angles(0.2 + -math.rad(80 * math.cos(sine/5)),math.rad(0),math.rad(12*math.cos(sine/5)))
  242.         leftleg.C0 = CFrame.new(-0.5,3*math.sin(sine/2.5)/10-1,math.cos(sine/5)/4) * CFrame.Angles(-math.rad(80 * math.cos(sine/5)),math.rad(0),math.rad(0))
  243.         rightleg.C0 = CFrame.new(0.5,3*math.sin(sine/2.5)/10-1,-math.cos(sine/5)/4) * CFrame.Angles(math.rad(80 * math.cos(sine/5)),math.rad(0),math.rad(0))
  244.         head.C0 = CFrame.new(0,1.4,0) * CFrame.Angles(-math.rad(4*math.cos(sine/4))+math.rad(15),math.rad(0),math.rad(0))
  245.     elseif anim == "walk" and cananimate then
  246.         alreadyjumped = false
  247.         if falling then
  248.             falling = false
  249.             fallbigsound:Play()
  250.         end
  251.         fallsound.Volume = 0
  252.         humanoidrootpart.C0 = CFrame.new(0,math.sin(sine/4)/15,0) * CFrame.Angles(math.rad(2*math.cos(sine/8))+math.rad(-5),math.rad(0),math.rad(2*math.cos(sine/8)))
  253.         leftarm.C0 = CFrame.new(-1.5,0.5,0) * CFrame.Angles(-math.rad(55 * math.cos(sine/8)),math.rad(0),math.rad(5*math.cos(sine/8)))
  254.         rightarm.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(math.rad(55 * math.cos(sine/8)),math.rad(0),math.rad(5*math.cos(sine/8)))
  255.         leftleg.C0 = CFrame.new(-0.5,-1.5*math.sin(sine/8)/8 -1,0) * CFrame.Angles(math.rad(55 * math.cos(sine/8)),math.rad(0),math.rad(0))
  256.         rightleg.C0 = CFrame.new(0.5,1.5*math.sin(sine/8)/8 -1,0) * CFrame.Angles(-math.rad(55 * math.cos(sine/8)),math.rad(0),math.rad(0))
  257.         head.C0 = CFrame.new(0,1.4,0) * CFrame.Angles(-math.rad(math.cos(sine/8))+math.rad(2.5),math.rad(0),math.rad(0))
  258.     end
  259. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement