KrYn0MoRe

mc character

Apr 28th, 2020
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 19.97 KB | None | 0 0
  1. local plr = owner
  2. local char = plr.Character
  3. local hum = char:FindFirstChildOfClass("Humanoid")
  4. if hum.RigType ~= Enum.HumanoidRigType.R6 then warn("You must be r6 to use this script.") return end
  5. local torso = char:FindFirstChild("Torso")
  6. local RootPart = char["HumanoidRootPart"]
  7. local RootJoint = RootPart["RootJoint"]
  8. local rarm,larm,rleg,lleg,head = char:FindFirstChild("Right Arm"),char:FindFirstChild("Left Arm"),char:FindFirstChild("Right Leg"),char:FindFirstChild("Left Leg"),char:FindFirstChild("Head")
  9. local char = plr.Character
  10.  
  11. local cos = math.cos
  12. local sin = math.sin
  13. local rad = math.rad
  14. local sine = 0
  15. local random = math.random
  16. local floor = math.floor
  17. local noise = math.noise
  18. local angles = CFrame.Angles
  19. local CF = CFrame.new
  20. local it=Instance.new
  21. local vt=Vector3.new
  22. local euler=CFrame.fromEulerAnglesXYZ
  23.  
  24. local debris = game:GetService("Debris")
  25. local tween = game:GetService("TweenService")
  26.  
  27. local lastcampos = Vector3.new(0,0,0)
  28. local idling = true
  29. local walking = false
  30. local damaged = false
  31. local hitting = false
  32. local shifting = false
  33. local sprinting = false
  34. local died = false
  35.  
  36. Model0 = Instance.new("Model")
  37. Part1 = Instance.new("Part")
  38. Part2 = Instance.new("Part")
  39. Part3 = Instance.new("Part")
  40. Part4 = Instance.new("Part")
  41. Part5 = Instance.new("Part")
  42. Part6 = Instance.new("Part")
  43. Model0.Name = "mc_char"
  44. Model0.Parent = char
  45. Part1.Name = "rl"
  46. Part1.Parent = Model0
  47. Part1.Color = rleg.Color
  48. Part1.Size = Vector3.new(1, 2, 1)
  49. Part1.BottomSurface = Enum.SurfaceType.Smooth
  50. Part1.Material = Enum.Material.SmoothPlastic
  51. Part1.TopSurface = Enum.SurfaceType.Smooth
  52. Part2.Name = "ra"
  53. Part2.Parent = Model0
  54. Part2.Color = rarm.Color
  55. Part2.Size = Vector3.new(1, 2.2, 1)
  56. Part2.BottomSurface = Enum.SurfaceType.Smooth
  57. Part2.Material = Enum.Material.SmoothPlastic
  58. Part2.TopSurface = Enum.SurfaceType.Smooth
  59. Part3.Name = "tors"
  60. Part3.Parent = Model0
  61. Part3.Color = torso.Color
  62. Part3.Size = Vector3.new(1, 2.1, 2)
  63. Part3.BottomSurface = Enum.SurfaceType.Smooth
  64. Part3.Material = Enum.Material.SmoothPlastic
  65. Part3.TopSurface = Enum.SurfaceType.Smooth
  66. Part4.Name = "la"
  67. Part4.Parent = Model0
  68. Part4.Color = larm.Color
  69. Part4.Size = Vector3.new(1, 2.2, 1)
  70. Part4.BottomSurface = Enum.SurfaceType.Smooth
  71. Part4.Material = Enum.Material.SmoothPlastic
  72. Part4.TopSurface = Enum.SurfaceType.Smooth
  73. Part5.Name = "hed"
  74. Part5.Parent = Model0
  75. Part5.Color = head.Color
  76. Part5.Size = Vector3.new(2, 2, 2)
  77. Part5.BottomSurface = Enum.SurfaceType.Smooth
  78. Part5.Material = Enum.Material.SmoothPlastic
  79. Part5.TopSurface = Enum.SurfaceType.Smooth
  80. Part6.Name = "ll"
  81. Part6.Parent = Model0
  82. Part6.Color = lleg.Color
  83. Part6.Size = Vector3.new(1, 2, 1)
  84. Part6.BottomSurface = Enum.SurfaceType.Smooth
  85. Part6.Material = Enum.Material.SmoothPlastic
  86. Part6.TopSurface = Enum.SurfaceType.Smooth
  87.  
  88. local shirt = char:FindFirstChild("Shirt")
  89. local pants = char:FindFirstChild("Pants")
  90.  
  91. if shirt then
  92.     shirt = shirt.ShirtTemplate
  93. end
  94. if pants then
  95.     pants = pants.PantsTemplate
  96. end
  97.  
  98. for i,v in pairs(char:GetDescendants()) do
  99. if v:IsA("Decal") or v:IsA("Texture") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("ShirtGraphic") or v:IsA("BodyColors") or v:IsA("Accessory") or v:IsA("Hat") then
  100. v:Destroy()
  101. end
  102. if v:IsA("Part") then
  103. v.CanCollide = false
  104. v.Transparency = 1
  105. end
  106. end
  107.  
  108. for i,v in pairs(hum:GetChildren()) do
  109. v:Destroy()
  110. end
  111.  
  112. local mc_char = Model0
  113.  
  114. for i,v in pairs(mc_char:GetDescendants()) do
  115. if v:IsA("UnionOperation") or v:IsA("Part") then
  116. v.Anchored = false
  117. v.CanCollide = false
  118. v.Transparency = 0
  119. end
  120. end
  121.  
  122. local face = Instance.new("Decal",mc_char['hed'])
  123. face.Texture = "rbxassetid://984409236"
  124.  
  125. local hats = {493450535,181335938,63036639,63723892,203973449}
  126.  
  127. local hatpart = Instance.new("Part",mc_char)
  128. hatpart.Anchored = false
  129. hatpart.CanCollide = false
  130. hatpart.Size = Vector3.new(1.6, 0.6, 1.8)
  131. local hatmesh = Instance.new("SpecialMesh",hatpart)
  132. hatmesh.MeshId = 'rbxassetid://72081410'
  133. hatmesh.TextureId = 'rbxassetid://' .. hats[math.random(1,#hats)]
  134.  
  135. hum.BreakJointsOnDeath = false
  136. hum.WalkSpeed = 16
  137.  
  138. local hitbox = Instance.new("Part",torso)
  139. hitbox.Transparency = 1
  140. hitbox.Size = Vector3.new(4,5,4)
  141. hitbox.CanCollide = false
  142.  
  143. ------------------------
  144. local ll = Instance.new("Weld")
  145. ll.Parent = lleg
  146. ll.Part0 = lleg
  147. ll.Part1 = mc_char['ll']
  148. ll.C0 = lleg.CFrame:Inverse()
  149. ll.C1 = mc_char['ll'].CFrame:Inverse()
  150. ll.C0 = CF(0,0,0)*angles(rad(0),rad(0),rad(0))
  151. ------------------------
  152. local rl = Instance.new("Weld")
  153. rl.Parent = rleg
  154. rl.Part0 = rleg
  155. rl.Part1 = mc_char['rl']
  156. rl.C0 = rleg.CFrame:Inverse()
  157. rl.C1 = mc_char['rl'].CFrame:Inverse()
  158. rl.C0 = CF(0,0,0)*angles(rad(0),rad(0),rad(0))
  159. ------------------------
  160. local la = Instance.new("Weld")
  161. la.Parent = larm
  162. la.Part0 = larm
  163. la.Part1 = mc_char['la']
  164. la.C0 = larm.CFrame:Inverse()
  165. la.C1 = mc_char['la'].CFrame:Inverse()
  166. la.C0 = CF(0,0,0)*angles(rad(0),rad(0),rad(0))
  167. ------------------------
  168. local ra = Instance.new("Weld")
  169. ra.Parent = rarm
  170. ra.Part0 = rarm
  171. ra.Part1 = mc_char['ra']
  172. ra.C0 = rarm.CFrame:Inverse()
  173. ra.C1 = mc_char['ra'].CFrame:Inverse()
  174. ra.C0 = CF(0,0,0)*angles(rad(0),rad(0),rad(0))
  175. ------------------------
  176. local hed = Instance.new("Weld")
  177. hed.Parent = head
  178. hed.Part0 = head
  179. hed.Part1 = mc_char['hed']
  180. hed.C0 = head.CFrame:Inverse()
  181. hed.C1 = mc_char['hed'].CFrame:Inverse()
  182. hed.C0 = CF(0,.6,0)*angles(rad(0),rad(0),rad(0))
  183. ------------------------
  184. local hat = Instance.new("Weld")
  185. hat.Parent = mc_char['hed']
  186. hat.Part0 = mc_char['hed']
  187. hat.Part1 = hatpart
  188. hat.C0 = mc_char['hed'].CFrame:Inverse()
  189. hat.C1 = hatpart.CFrame:Inverse()
  190. hat.C0 = CF(0,1.2,0)*angles(rad(5),rad(0),rad(0))
  191. ------------------------
  192. local tors = Instance.new("Weld")
  193. tors.Parent = torso
  194. tors.Part0 = torso
  195. tors.Part1 = mc_char['tors']
  196. tors.C0 = torso.CFrame:Inverse()
  197. tors.C1 = mc_char['tors'].CFrame:Inverse()
  198. tors.C0 = CF(0,.05,0)*angles(rad(0),rad(90),rad(0))
  199. ----------------------------------------------
  200. local hb = Instance.new("Weld")
  201. hb.Parent = torso
  202. hb.Part0 = torso
  203. hb.Part1 = hitbox
  204. hb.C0 = torso.CFrame:Inverse()
  205. hb.C1 = hitbox.CFrame:Inverse()
  206. hb.C0 = CF(0,0,-1)*angles(rad(0),rad(0),rad(0))
  207. ----------------------------------------------
  208.  
  209.  
  210.  
  211. function lerp(object, newCFrame, alpha)
  212.   return object:lerp(newCFrame, alpha)
  213. end
  214.  
  215. New = function(Object, Parent, Name, Data)
  216.     local Object = Instance.new(Object)
  217.     for Index, Value in pairs(Data or {}) do
  218.         Object[Index] = Value
  219.     end
  220.     Object.Parent = Parent
  221.     Object.Name = Name
  222.     return Object
  223. end
  224.  
  225. function weld(parent,part0,part1,c0)
  226. local weld=it("Weld")
  227. weld.Parent=parent
  228. weld.Part0=part0
  229. weld.Part1=part1
  230. weld.C0=c0
  231. return weld
  232. end
  233.  
  234. ArtificialHB = Instance.new("BindableEvent", script)
  235. ArtificialHB.Name = "ArtificialHB"
  236.  
  237. script:WaitForChild("ArtificialHB")
  238. Frame_Speed = 1 / 60
  239. frame = Frame_Speed
  240. tf = 0
  241. allowframeloss = false
  242. tossremainder = false
  243. lastframe = tick()
  244. script.ArtificialHB:Fire()
  245.  
  246. game:GetService("RunService").Heartbeat:connect(function(s, p)
  247.     tf = tf + s
  248.     if tf >= frame then
  249.         if allowframeloss then
  250.             script.ArtificialHB:Fire()
  251.             lastframe = tick()
  252.         else
  253.             for i = 1, math.floor(tf / frame) do
  254.                 script.ArtificialHB:Fire()
  255.             end
  256.         lastframe = tick()
  257.         end
  258.         if tossremainder then
  259.             tf = 0
  260.         else
  261.             tf = tf - frame * math.floor(tf / frame)
  262.         end
  263.     end
  264. end)
  265.  
  266. function swait(num)
  267. if num == 0 or num == nil then
  268.         ArtificialHB.Event:wait()
  269.     else
  270.         for i = 1, num do
  271.             ArtificialHB.Event:wait()
  272.         end
  273.     end
  274. end
  275.  
  276. function play(id,par,vol,pitch,loop,starting,ending)
  277.     local current = Instance.new("Sound",par)
  278.     current.SoundId = "rbxassetid://" ..id
  279.     current.Parent = par or script
  280.     current.Volume = vol or 1
  281.     current.PlaybackSpeed = pitch or 1
  282.     current.Looped = loop or false
  283.     current:Play()
  284.     current.TimePosition = starting or 0
  285.     spawn(function()
  286.         if ending ~= nil and tonumber(ending) then
  287.             repeat wait() until current.TimePositon >= ending
  288.             current:Stop()
  289.             debris:AddItem(current,1)
  290.         else
  291.             repeat wait() until not current.IsPlaying
  292.             debris:AddItem(current,1)
  293.         end
  294.     end)
  295.     return current
  296. end
  297.  
  298. function rayCast(Pos, Dir, Max, Ignore)
  299. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  300. end
  301.  
  302. local punch1 = Instance.new("Sound",tors)
  303. punch1.SoundId = "rbxassetid://3362346832"
  304. punch1.Volume = 2
  305. local punch2 = Instance.new("Sound",tors)
  306. punch2.SoundId = "rbxassetid://3362337129"
  307. punch2.Volume = 2
  308. local death = Instance.new("Sound",tors)
  309. death.SoundId = "rbxassetid://535690488"
  310. death.Volume = 2
  311.  
  312. function hit()
  313.     local connection
  314.     connection = hitbox.Touched:Connect(function(obj)
  315.         local targethum = obj.Parent:FindFirstChildOfClass("Humanoid")
  316.         if obj and obj.Parent and targethum and targethum.Parent and obj.Parent.ClassName == "Model" and not targethum:FindFirstChild("Fist Hit") then
  317.             if targethum.Health > 0 then
  318.                 local confirm = Instance.new("IntValue",targethum)
  319.                 confirm.Name = "Fist Hit"
  320.                 debris:AddItem(confirm,.12)
  321.                 targethum.Health = targethum.Health - 10
  322.                 --play("3362346832",obj,2)
  323.                 punch1:Play()
  324.                 for i,v in pairs(obj.Parent:GetChildren()) do
  325.                     if (v:IsA("Part") or v:IsA("WedgePart") or v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("UnionOperation")) and v.Name ~= "effects" then
  326.                         local box = Instance.new("SelectionBox",v)
  327.                         box.Adornee = v
  328.                         box.Color3 = Color3.new(1,0,0)
  329.                         box.SurfaceColor3 = Color3.new(1,0,0)
  330.                         box.SurfaceTransparency = .75
  331.                         box.LineThickness = 0
  332.                         box.Transparency = 1
  333.                         game:GetService("Debris"):AddItem(box,.5)
  334.                     end
  335.                 end
  336.             end
  337.         end
  338.     end)
  339.     wait(.12)
  340.     connection:Disconnect()
  341. end
  342.  
  343. local currentHealth = hum.Health
  344. hum.HealthChanged:Connect(function(health)
  345.     if (health >= currentHealth) or (died) then return end
  346.     local change = math.abs(currentHealth - health)
  347.     local left = change
  348.     currentHealth = health
  349.     if math.random(1,2) == 1 then
  350.         --play("3362346832",torso,2)
  351.         punch1:Play()
  352.     else
  353.         --play("3362337129",torso,2)
  354.         punch2:Play()
  355.     end
  356.     if not damaged then
  357.         damaged = true
  358.     end
  359.     for i,v in pairs(mc_char:GetChildren()) do
  360.         if (v:IsA("Part") or v:IsA("WedgePart") or v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("UnionOperation")) and v.Name ~= "effects" then
  361.             local box = Instance.new("SelectionBox",v)
  362.             box.Adornee = v
  363.             box.Color3 = Color3.new(1,0,0)
  364.             box.SurfaceColor3 = Color3.new(1,0,0)
  365.             box.SurfaceTransparency = .75
  366.             box.LineThickness = 0
  367.             box.Transparency = 1
  368.             game:GetService("Debris"):AddItem(box,.5)
  369.         end
  370.     end
  371.     spawn(function()
  372.         wait(.25)
  373.         damaged = false
  374.     end)
  375. end)
  376.  
  377. hum.Died:Connect(function()
  378.     died = true
  379.     --play("535690488",torso,2)
  380.     death:Play()
  381.     for i,v in pairs(mc_char:GetChildren()) do
  382.         if (v:IsA("Part") or v:IsA("WedgePart") or v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("UnionOperation")) and v.Name ~= "effects" then
  383.             local box = Instance.new("SelectionBox",v)
  384.             box.Adornee = v
  385.             box.Color3 = Color3.new(1,0,0)
  386.             box.SurfaceColor3 = Color3.new(1,0,0)
  387.             box.SurfaceTransparency = .75
  388.             box.LineThickness = 0
  389.             box.Transparency = 1
  390.         end
  391.     end
  392.     for i,v in pairs(char:GetDescendants()) do
  393.         if v:IsA("Part") or v:IsA("WedgePart") or v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
  394.             v.CanCollide = false
  395.         end
  396.     end
  397.     wait(.25)
  398.     for i,v in pairs(char:GetDescendants()) do
  399.         if v:IsA("Part") or v:IsA("WedgePart") or v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
  400.             v.Anchored = true
  401.         end
  402.     end
  403. end)
  404.  
  405. ------------------------------------------
  406.  
  407. local remote = Instance.new("RemoteEvent",char)
  408. remote.Name = "mc_char_remote"
  409.  
  410. local code = [[
  411. local mouse = game:GetService("Players").LocalPlayer:GetMouse()
  412. local remote = script.Parent
  413. mouse.Button1Down:Connect(function()
  414.     remote:FireServer(1,nil)
  415. end)
  416. spawn(function()
  417.     while wait(.1) do
  418.         remote:FireServer(4,mouse.Hit.p)
  419.     end
  420. end)
  421. mouse.KeyDown:Connect(function(key)
  422.     if string.byte(key) == 50 then
  423.         remote:FireServer(2,true)
  424.     end
  425.     if string.byte(key) == 48 then
  426.         remote:FireServer(3,true)
  427.     end
  428. end)
  429. mouse.KeyUp:Connect(function(key)
  430.     if string.byte(key) == 50 then
  431.         remote:FireServer(2,false)
  432.     end
  433.     if string.byte(key) == 48 then
  434.         remote:FireServer(3,false)
  435.     end
  436. end)
  437. ]]
  438.  
  439. NLS(code,remote)
  440.  
  441. remote.OnServerEvent:Connect(function(plr,mode,data)
  442.     if mode == 4 and not died then
  443.         lastcampos = data
  444.     end
  445.     if mode == 1 and not died and not hitting then
  446.         spawn(function()
  447.             hitting = true
  448.             hit()
  449.             hitting = false
  450.         end)
  451.     end
  452.     if mode == 2 and not died and not sprinting then
  453.         if data then
  454.             shifting = true
  455.             hum.WalkSpeed = 7
  456.         elseif not data then
  457.             shifting = false
  458.             hum.WalkSpeed = 16
  459.         end
  460.     end
  461.     if mode == 3 and not died and not shifting then
  462.         if data then
  463.             sprinting = true
  464.             hum.WalkSpeed = 40
  465.         elseif not data then
  466.             sprinting = false
  467.             hum.WalkSpeed = 16
  468.         end
  469.     end
  470. end)
  471.  
  472. ------------------------------------------
  473.  
  474. --[[spawn(function()
  475.     while wait(0) do
  476.         local Y, X, Z = workspace.CurrentCamera.CFrame:toEulerAnglesYXZ()
  477.         Y = -Y-math.rad(90)
  478.         if X > 0 and X < 1.57 then
  479.             X = X+(1.57-X)*2
  480.         elseif X < 0 and X > -1.57 then
  481.             X = X+(-1.57-X)*2
  482.         end
  483.         print(X+Y+Z)
  484.         hed.C0=lerp(hed.C0,hed.C0*CF(0,.6,0)*angles(rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)))*angles(rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60))),.5)
  485.     end
  486. end)]]
  487.  
  488. ------------------------------------------
  489.  
  490. spawn(function()
  491. while wait(0) do
  492. spawn(function()
  493.     sine = sine+5*wait()/(1/30)
  494. end)
  495. local torvel=(torso.Velocity*Vector3.new(1,0,1)).magnitude
  496. local hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,char)
  497. if not died then
  498.     if damaged then -- damaged
  499.         if math.random(1,2) == 1 then
  500.             la.C0=lerp(ll.C0,CF(0,0,.3)*angles(rad(-25), rad(0), rad(0)),1)
  501.             ra.C0=lerp(ra.C0,CF(0,0,-.3)*angles(rad(25), rad(0), rad(0)),1)
  502.             ll.C0=lerp(ll.C0,CF(0,0,-.3)*angles(rad(25), rad(0), rad(0)),1)
  503.             rl.C0=lerp(rl.C0,CF(0,0,.3)*angles(rad(-25), rad(0), rad(0)),1)
  504.             tors.C0=lerp(tors.C0,CF(0,.05,0)*angles(rad(0), rad(90), rad(0)),1)
  505.             hed.C0=lerp(hed.C0,CF(head.Position,lastcampos)*CF(0,.6,0)*angles(rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)))*angles(rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60))),1)
  506.             wait(.25)
  507.         else
  508.             la.C0=lerp(ll.C0,CF(0,0,-.3)*angles(rad(25), rad(0), rad(0)),1)
  509.             ra.C0=lerp(ra.C0,CF(0,0,.3)*angles(rad(-25), rad(0), rad(0)),1)
  510.             ll.C0=lerp(ll.C0,CF(0,0,.3)*angles(rad(-25), rad(0), rad(0)),1)
  511.             rl.C0=lerp(rl.C0,CF(0,0,-.3)*angles(rad(25), rad(0), rad(0)),1)
  512.             tors.C0=lerp(tors.C0,CF(0,.05,0)*angles(rad(0), rad(90), rad(0)),1)
  513.             hed.C0=lerp(hed.C0,CF(head.Position,lastcampos)*CF(0,.6,0)*angles(rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)))*angles(rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60))),1)
  514.             wait(.25)
  515.         end
  516.     elseif shifting and torvel < 1 then -- shift
  517.         walking = false
  518.         idling = true
  519.         la.C0=lerp(ll.C0,CF(0,-.5,0)*angles(rad(-45 - 3 * cos(sine / 40)), rad(0), rad(0 - 3 * cos(sine / 43))),1)
  520.         if not hitting then
  521.             ra.C0=lerp(ra.C0,CF(0,-.5,0)*angles(rad(-45 + 3 * cos(sine / 40)), rad(0), rad(0 + 3 * cos(sine / 43))),1)
  522.         else
  523.             ra.C0=lerp(ra.C0,CF(-.5,.3,-.6)*angles(rad(80), rad(0), rad(-25)),.5)
  524.         end
  525.         ll.C0=lerp(ll.C0,CF(0,0,.6)*angles(rad(0 - 2 * cos(sine / 65)), rad(0), rad(0 - 2 * cos(sine / 70))),1)
  526.         rl.C0=lerp(rl.C0,CF(0,0,.6)*angles(rad(0), rad(0), rad(0)),1)
  527.         tors.C0=lerp(tors.C0,CF(0,-.5,0)*angles(rad(-45), rad(90), rad(0)),1)
  528.         hed.C0=lerp(hed.C0,CF(head.Position,lastcampos)*CF(0,-.4,-.4)*angles(rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)))*angles(rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60))),1)
  529.     elseif shifting and torvel > 1 then -- shift walk
  530.         walking = true
  531.         idling = false
  532.         la.C0=lerp(ll.C0,CF(0,-.5,0)*angles(rad(-45 - 10 * cos(sine / 40)), rad(0), rad(0 - 3 * cos(sine / 43))),1)
  533.         if not hitting then
  534.             ra.C0=lerp(ra.C0,CF(0,-.5,0)*angles(rad(-45 + 10 * cos(sine / 40)), rad(0), rad(0 + 3 * cos(sine / 43))),1)
  535.         else
  536.             ra.C0=lerp(ra.C0,CF(-.5,.3,-.6)*angles(rad(80), rad(0), rad(-25)),.5)
  537.         end
  538.         ll.C0=lerp(ll.C0,CF(0,0,.6)*angles(rad(12 * cos(sine / 30)), rad(0), rad(0)),1)
  539.         rl.C0=lerp(rl.C0,CF(0,0,.6)*angles(rad(-12 * cos(sine / 30)), rad(0), rad(0)),1)
  540.         tors.C0=lerp(tors.C0,CF(0,-.5,0)*angles(rad(-45), rad(90), rad(0)),1)
  541.         hed.C0=lerp(hed.C0,CF(head.Position,lastcampos)*CF(0,-.4,-.4)*angles(rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)))*angles(rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60))),1)
  542.     elseif torvel < 1 then -- idle
  543.         walking = false
  544.         idling = true
  545.         la.C0=lerp(ll.C0,angles(rad(0 - 3 * cos(sine / 40)), rad(0), rad(0 - 3 * cos(sine / 43))),.5)
  546.         if not hitting then
  547.             ra.C0=lerp(ra.C0,angles(rad(0 + 3 * cos(sine / 40)), rad(0), rad(0 + 3 * cos(sine / 43))),.5)
  548.         else
  549.             ra.C0=lerp(ra.C0,CF(-.5,.3,-.6)*angles(rad(80), rad(0), rad(-25)),.5)
  550.         end
  551.         ll.C0=lerp(ll.C0,angles(rad(0 - 2 * cos(sine / 65)), rad(0), rad(0 - 2 * cos(sine / 70))),.5)
  552.         rl.C0=lerp(rl.C0,angles(rad(0), rad(0), rad(0)),.5)
  553.         tors.C0=lerp(tors.C0,CF(0,.05,0)*angles(rad(0), rad(90), rad(0)),.5)
  554.         hed.C0=lerp(hed.C0,CF(head.Position,lastcampos)*CF(0,.6,0)*angles(rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)))*angles(rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60))),1)
  555.     elseif sprinting and torvel > 5 then -- sprinting
  556.         walking = true
  557.         idling = false
  558.         la.C0=lerp(la.C0,CF(0,.4,0 - 1 * cos(sine / 14) + .1 * cos(sine / 30))*angles(rad(120 * cos(sine / 14)), rad(0), rad(0 + 7 * cos(sine / 14))),.7)
  559.         if not hitting then
  560.             ra.C0=lerp(ra.C0,CF(0,.4,0 - -1 * cos(sine / 14) + .1 * cos(sine / 30))*angles(rad(-120 * cos(sine / 14)), rad(0 + 7 * cos(sine / 14)), rad(0)),.7)
  561.         else
  562.             ra.C0=lerp(ra.C0,CF(-.5,.3,-.6)*angles(rad(80), rad(0), rad(-25)),.5)
  563.         end
  564.         ll.C0=lerp(ll.C0,CF(0,.4,0 - 1 * cos(sine / 14) + .1 * cos(sine / 30))*angles(rad(120 * cos(sine / 14)), rad(0 + 7 * cos(sine / 14)), rad(0)),.7)
  565.         rl.C0=lerp(rl.C0,CF(0,.4,0 - -1 * cos(sine / 14) + .1 * cos(sine / 30))*angles(rad(-120 * cos(sine / 14)), rad(0 + 7 * cos(sine / 14)), rad(0)),.7)
  566.         tors.C0=lerp(tors.C0,CF(0,.05 - .1 * cos(sine / 16),0)*angles(rad(0), rad(90), rad(0)),.7)
  567.         hed.C0=lerp(hed.C0,CF(head.Position,lastcampos)*CF(0,.6 - .1 * cos(sine / 16),0)*angles(rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)))*angles(rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60))),1)
  568.     elseif torvel > 1 then -- walking
  569.         walking = true
  570.         idling = false
  571.         la.C0=lerp(la.C0,CF(0,0,0 - .3 * cos(sine / 24) + .05 * cos(sine / 16))*angles(rad(32 * cos(sine / 24)), rad(0), rad(0 + 4 * cos(sine / 24))),.5)
  572.         if not hitting then
  573.             ra.C0=lerp(ra.C0,CF(0,0,0 - -.3 * cos(sine / 24) + .05 * cos(sine / 16))*angles(rad(-32 * cos(sine / 24)), rad(0), rad(0 + 4 * cos(sine / 24))),.5)
  574.         else
  575.             ra.C0=lerp(ra.C0,CF(-.5,.3,-.6)*angles(rad(80), rad(0), rad(-25)),.5)
  576.         end
  577.         ll.C0=lerp(ll.C0,CF(0,0,0 - .3 * cos(sine / 24) + .05 * cos(sine / 16))*angles(rad(24 * cos(sine / 24)), rad(0 + 7 * cos(sine / 24)), rad(0)),.5)
  578.         rl.C0=lerp(rl.C0,CF(0,0,0 - -.3 * cos(sine / 24) + .05 * cos(sine / 16))*angles(rad(-24 * cos(sine / 24)), rad(0 + 7 * cos(sine / 24)), rad(0)),.5)
  579.         tors.C0=lerp(tors.C0,CF(0,.05 - .05 * cos(sine / 16),0)*angles(rad(0), rad(90), rad(0)),.5)
  580.         hed.C0=lerp(hed.C0,CF(head.Position,lastcampos)*CF(0,.6 - .05 * cos(sine / 16),0)*angles(rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)),rad(0 + 1 * cos(sine / 60)))*angles(rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60)),rad(0 - 2 * cos(sine / 60))),1)
  581.     end
  582. elseif died then
  583.     RootJoint.C0=lerp(RootJoint.C0,angles(rad(0), rad(0), rad(90)),.5)
  584. end
  585. end
  586. end)
Add Comment
Please, Sign In to add comment