Advertisement
DrawingJhon

Snake v2

Aug 14th, 2022 (edited)
888
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.34 KB | None | 0 0
  1. HumanDied = false for i,v in next, game:GetService("Players").LocalPlayer.Character:GetDescendants() do if v:IsA("BasePart") then  _G.netless=game:GetService("RunService").Heartbeat:connect(function() v.AssemblyLinearVelocity = Vector3.new(-30,0,0) sethiddenproperty(game.Players.LocalPlayer,"MaximumSimulationRadius",math.huge) sethiddenproperty(game.Players.LocalPlayer,"SimulationRadius",999999999) end) end end  local plr = game.Players.LocalPlayer local char = plr.Character local srv = game:GetService('RunService') local ct = {}  char.Archivable = true local reanim = char:Clone() reanim.Name = 'Nexo '..plr.Name..'' fl=Instance.new('Folder',char) fl.Name ='Nexo' reanim.Animate.Disabled=true char.HumanoidRootPart:Destroy() char.Humanoid:ChangeState(16)  for i,v in next, char.Humanoid:GetPlayingAnimationTracks() do v:Stop() end char.Animate:Remove()  function create(part, parent, p, r) Instance.new("Attachment",part) Instance.new("AlignPosition",part) Instance.new("AlignOrientation",part) Instance.new("Attachment",parent) part.Attachment.Name = part.Name parent.Attachment.Name = part.Name part.AlignPosition.Attachment0 = part[part.Name] part.AlignOrientation.Attachment0 = part[part.Name] part.AlignPosition.Attachment1 = parent[part.Name] part.AlignOrientation.Attachment1 = parent[part.Name] parent[part.Name].Position = p or Vector3.new() part[part.Name].Orientation = r or Vector3.new() part.AlignPosition.MaxForce = 999999999 part.AlignPosition.MaxVelocity = math.huge part.AlignPosition.ReactionForceEnabled = false part.AlignPosition.Responsiveness = math.huge part.AlignOrientation.Responsiveness = math.huge part.AlignPosition.RigidityEnabled = false part.AlignOrientation.MaxTorque = 999999999 end  for i,v in next, char:GetDescendants() do if v:IsA('Accessory') then v.Handle:BreakJoints() create(v.Handle,reanim[v.Name].Handle) end end  char.Torso['Left Shoulder']:Destroy() char.Torso['Right Shoulder']:Destroy() char.Torso['Left Hip']:Destroy() char.Torso['Right Hip']:Destroy()  create(char['Torso'],reanim['Torso']) create(char['Left Arm'],reanim['Left Arm']) create(char['Right Arm'],reanim['Right Arm']) create(char['Left Leg'],reanim['Left Leg']) create(char['Right Leg'],reanim['Right Leg'])  for i,v in next, reanim:GetDescendants() do if v:IsA('BasePart') or v:IsA('Decal') then v.Transparency = 1 end end  reanim.Parent = fl  for i,v in next, reanim:GetDescendants() do if v:IsA('BasePart') then table.insert(ct,srv.RenderStepped:Connect(function() v.CanCollide = false end)) end end  for i,v in next, char:GetDescendants() do if v:IsA('BasePart') then table.insert(ct,srv.RenderStepped:Connect(function() v.CanCollide = false end)) end end  for i,v in next, reanim:GetDescendants() do if v:IsA('BasePart') then table.insert(ct,srv.Stepped:Connect(function() v.CanCollide = false end)) end end  for i,v in next, char:GetDescendants() do if v:IsA('BasePart') then table.insert(ct,srv.Stepped:Connect(function() v.CanCollide = false end)) end end  table.insert(ct,reanim.Humanoid.Died:Connect(function() plr.Character = char char:BreakJoints() reanim:Destroy() game.Players:Chat('-gr') _G.netless:Disconnect() HumanDied = true for _,v in pairs(ct) do v:Disconnect() end end))  plr.Character = reanim workspace.CurrentCamera.CameraSubject = reanim.Humanoid
  2.  
  3. IT = Instance.new
  4. CF = CFrame.new
  5. VT = Vector3.new
  6. RAD = math.rad
  7. C3 = Color3.new
  8. UD2 = UDim2.new
  9. BRICKC = BrickColor.new
  10. ANGLES = CFrame.Angles
  11. EULER = CFrame.fromEulerAnglesXYZ
  12. COS = math.cos
  13. ACOS = math.acos
  14. SIN = math.sin
  15. ASIN = math.asin
  16. ABS = math.abs
  17. MRANDOM = math.random
  18. FLOOR = math.floor
  19.  
  20. speed = 1
  21. sine = 1
  22. srv = game:GetService('RunService')
  23.  
  24. reanim = game.Players.LocalPlayer.Character
  25.  
  26. local uis = game:GetService("UserInputService")
  27. local player = game:GetService("Players").LocalPlayer
  28.  
  29. m=game.Players.LocalPlayer:GetMouse()
  30. RJ = {C0 = CFrame.new(); C1 = CFrame.new()}
  31. RS = reanim.Torso['Right Shoulder']
  32. LS = reanim.Torso['Left Shoulder']
  33. RH = reanim.Torso['Right Hip']
  34. LH = reanim.Torso['Left Hip']
  35. Root = reanim.HumanoidRootPart
  36. NECK = {C0 = CFrame.new(); C1 = CFrame.new()}
  37. Root = reanim.HumanoidRootPart
  38. NECK = reanim.Torso.Neck
  39. NECK.C0 = CF(0,1,0)*ANGLES(RAD(0),RAD(0),RAD(0))
  40. NECK.C1 = CF(0,-0.5,0)*ANGLES(RAD(0),RAD(0),RAD(0))
  41. RJ.C1 = CF(0,-1,0)*ANGLES(RAD(0),RAD(0),RAD(0))
  42. RJ.C0 = CF(0,0,0)*ANGLES(RAD(0),RAD(0),RAD(0))
  43. RS.C1 = CF(0,0.5,0)*ANGLES(RAD(0),RAD(0),RAD(0))
  44. LS.C1 = CF(0,0.5,0)*ANGLES(RAD(0),RAD(0),RAD(0))
  45. RH.C1 = CF(0,1,0)*ANGLES(RAD(0),RAD(0),RAD(0))
  46. LH.C1 = CF(0,1,0)*ANGLES(RAD(0),RAD(0),RAD(0))
  47. RH.C0 = CF(0,0,0)*ANGLES(RAD(0),RAD(0),RAD(0))
  48. LH.C0 = CF(0,0,0)*ANGLES(RAD(0),RAD(0),RAD(0))
  49. RS.C0 = CF(0,0,0)*ANGLES(RAD(0),RAD(0),RAD(0))
  50. LS.C0 = CF(0,0,0)*ANGLES(RAD(0),RAD(0),RAD(0))
  51.  
  52. local lastPos = Root.Position
  53.  
  54. reanim:PivotTo(reanim:GetPivot() * CFrame.new(0, -20, 0))
  55. Root.Anchored = true
  56.  
  57. wait()
  58.  
  59. local model = Instance.new("Model", workspace)
  60. local root = Instance.new("Part", model)
  61. root.Name = "HumanoidRootPart"
  62. root.Size = Vector3.new(2, 2, 1)
  63. root.Position = lastPos + Vector3.new(0, 3, 0)
  64. root.CanCollide = false
  65. root.Transparency =  0.9
  66. local torso = root:Clone()
  67. torso.Transparency = 1
  68. local weld = Instance.new("Weld", torso)
  69. weld.Part0 = torso
  70. weld.Part1 = root
  71. weld.C0 = CFrame.new(0, 1, 0)
  72. torso.Parent = model
  73. torso.Massless = true
  74. local hum = Instance.new("Humanoid", model)
  75. hum.HipHeight = 2
  76. hum.AutoJumpEnabled = false
  77. player.Character = model
  78. workspace.CurrentCamera.CameraSubject = hum
  79.  
  80. hum.Died:Connect(function()
  81.     player.Character = char
  82.     char:BreakJoints()
  83.     model:Destroy()
  84.     reanim:Destroy()
  85. end)
  86.  
  87. RS.Part0 = torso
  88. LS.Part0 = torso
  89. RH.Part0 = torso
  90. LH.Part0 = torso
  91.  
  92. local Root = root
  93.  
  94. coroutine.wrap(function()
  95. while true do -- anim changer
  96. if HumanDied then break end
  97. sine = sine + speed
  98. local rlegray = Ray.new(reanim["Right Leg"].Position + Vector3.new(0, 0.5, 0), Vector3.new(0, -2, 0))
  99. local rlegpart, rlegendPoint = workspace:FindPartOnRay(rlegray, char)
  100. local llegray = Ray.new(reanim["Left Leg"].Position + Vector3.new(0, 0.5, 0), Vector3.new(0, -2, 0))
  101. local llegpart, llegendPoint = workspace:FindPartOnRay(llegray, char)
  102. local rightvector = (Root.Velocity * Root.CFrame.rightVector).X + (Root.Velocity * Root.CFrame.rightVector).Z
  103. local lookvector = (Root.Velocity * Root.CFrame.lookVector).X + (Root.Velocity * Root.CFrame.lookVector).Z
  104. if lookvector > hum.WalkSpeed then
  105. lookvector = hum.WalkSpeed
  106. end
  107. if lookvector < -hum.WalkSpeed then
  108. lookvector = -hum.WalkSpeed
  109. end
  110. if rightvector > hum.WalkSpeed then
  111. rightvector = hum.WalkSpeed
  112. end
  113. if rightvector < -hum.WalkSpeed then
  114. rightvector = -hum.WalkSpeed
  115. end
  116. local lookvel = lookvector / hum.WalkSpeed
  117. local rightvel = rightvector / hum.WalkSpeed
  118. if hum.Jump then -- jump
  119. NECK.C0=NECK.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),1+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  120. RJ.C0=RJ.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),2.54+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  121. RS.C0=RS.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),0+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  122. LS.C0=LS.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-1.76+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  123. RH.C0=RH.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-2.83+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  124. LH.C0=LH.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-4.44+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  125. elseif Root.Velocity.y < -1 and hum.Jump then -- fall
  126. NECK.C0=NECK.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),1+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  127. RJ.C0=RJ.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),2.54+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  128. RS.C0=RS.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),0+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  129. LS.C0=LS.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-1.76+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  130. RH.C0=RH.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-2.83+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  131. LH.C0=LH.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-4.44+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  132. elseif Root.Velocity.Magnitude < 2 then -- idle
  133. NECK.C0=NECK.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),1+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  134. RJ.C0=RJ.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-2+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  135. RS.C0=RS.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-1.5+0*math.cos(sine/10),0.93+0*math.cos(sine/10))*CFrame.Angles(math.rad(120.21+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  136. LS.C0=LS.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-1.5+0*math.cos(sine/10),1.47+0*math.cos(sine/10))*CFrame.Angles(math.rad(270+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  137. RH.C0=RH.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-1.5+0*math.cos(sine/10),2.9+0*math.cos(sine/10))*CFrame.Angles(math.rad(242.48+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+5.58*math.cos(sine/10))),.2)
  138. LH.C0=LH.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-0.68+0*math.cos(sine/10),4.69+0*math.cos(sine/10))*CFrame.Angles(math.rad(219.55+13.23*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+59.08*math.cos(sine/10))),.2)
  139. elseif Root.Velocity.Magnitude < 20 then -- walk
  140. NECK.C0=NECK.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),1+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  141. RJ.C0=RJ.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-2+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  142. RS.C0=RS.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-1.5+0*math.cos(sine/10),0.93+0*math.cos(sine/10))*CFrame.Angles(math.rad(120.21+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  143. LS.C0=LS.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-1.5+0*math.cos(sine/10),1.47+0*math.cos(sine/10))*CFrame.Angles(math.rad(270+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  144. RH.C0=RH.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-1.5+0*math.cos(sine/10),2.9+0*math.cos(sine/10))*CFrame.Angles(math.rad(270+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+2*math.cos(sine/10))),.2)
  145. LH.C0=LH.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-1.5+0*math.cos(sine/10),4.69+0*math.cos(sine/10))*CFrame.Angles(math.rad(270+-2.06*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+28.51*math.cos(sine/10))),.2)
  146. elseif Root.Velocity.Magnitude > 20 then -- run
  147. NECK.C0=NECK.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),1+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  148. RJ.C0=RJ.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-2+0*math.cos(sine/10),0+0*math.cos(sine/10))*CFrame.Angles(math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  149. RS.C0=RS.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-1.5+0*math.cos(sine/10),0.93+0*math.cos(sine/10))*CFrame.Angles(math.rad(120.21+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  150. LS.C0=LS.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-1.5+0*math.cos(sine/10),1.47+0*math.cos(sine/10))*CFrame.Angles(math.rad(270+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10))),.2)
  151. RH.C0=RH.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-1.5+0*math.cos(sine/10),2.9+0*math.cos(sine/10))*CFrame.Angles(math.rad(270+0*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+2*math.cos(sine/10))),.2)
  152. LH.C0=LH.C0:Lerp(CFrame.new(0+0*math.cos(sine/10),-1.5+0*math.cos(sine/10),4.69+0*math.cos(sine/10))*CFrame.Angles(math.rad(270+-2.06*math.cos(sine/10)),math.rad(0+0*math.cos(sine/10)),math.rad(0+28.51*math.cos(sine/10))),.2)
  153. end
  154. srv.RenderStepped:Wait()
  155. end
  156. model:Destroy()
  157. end)()
  158. --Created using Nexo Animator V4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement