Advertisement
coolgoldboy166

inmortal

Nov 26th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. Services = setmetatable({},{__index=function(s,r) return game:service(r) end})
  2. Player = Services.Players.LocalPlayer
  3. wait()script.Parent=nil
  4. BodyParts={}
  5. abs = function(int)
  6. if int < 0 then return -int else return int end
  7. end
  8. rad = function(deg)
  9. return deg * math.pi / 180
  10. end
  11. deg = function(rad)
  12. return rad * 180 / math.pi
  13. end
  14. dist = function(p1,p2)
  15. r,e = ypcall(function()
  16. p1 = p1.Position
  17. end)
  18. if not r then p1 = p1 end
  19. r,e = ypcall(function()
  20. p2 = p2.Position
  21. end)
  22. if not r then p1 = p1 end
  23. return math.sqrt( (p2.X-p1.X)^2 + (p2.Y-p1.Y)^2 + (p2.Z-p1.Z)^2 )
  24. end
  25.  
  26. function GetChar()
  27. return Player.Character
  28. end
  29. function GetHum()
  30. for i,v in pairs(GetChar():children'') do
  31. if v.ClassName == 'Humanoid' then
  32. return v
  33. end
  34. end
  35. end
  36.  
  37. function Died()
  38. for i,v in pairs(GetChar():children'') do
  39. if v.ClassName == 'Part' then
  40. table.insert(BodyParts,{v.CFrame,v})
  41. elseif v.ClassName == 'Hat' then
  42. v.Parent=workspace
  43. table.insert(BodyParts,{v.Handle.CFrame,v.Handle,1})
  44. end
  45. end
  46.  
  47. wait(3)
  48. for i,v in pairs(BodyParts) do
  49. v[2].Anchored=true
  50. if v[2].Name == 'Torso' then pos = v[1] end
  51. end
  52.  
  53. for i,v in pairs(BodyParts) do
  54. coroutine.resume(coroutine.create(function()
  55. repeat Services.RunService.Heartbeat:wait()
  56. v[2].CFrame = v[2].CFrame:lerp(v[1],.1)
  57. until dist(v[2],v[1]) < .05
  58. v[2].CFrame=v[1]
  59. end))
  60. end
  61. end
  62.  
  63. Player.CharacterAdded:connect(function(char)
  64. char:WaitForChild('Torso')
  65. for i,v in pairs(BodyParts) do
  66. if v[3] then
  67. v[2]:Remove()
  68. end
  69. end
  70. BodyParts={}
  71. char.Torso.CFrame=pos or CFrame.new(0,12,0)
  72. GetHum().Died:connect(Died)
  73. end)
  74. GetHum().Died:connect(Died)
  75. print'rannering'
  76.  
  77. r2 = "Cyan"
  78.  
  79. --declarations
  80. PI=math.pi
  81. TAU=PI*2
  82. DEBRIS=game:service'Debris'
  83. mr,md=math.random,math.rad
  84. cfn,v3n=CFrame.new,Vector3.new
  85. _A=nil
  86. ang=function(x,y,z)local a=CFrame.Angles(x or 0,y or 0,z or 0)_A=a return a end
  87. RS=game:service'RunService'
  88. numkp=NumberSequenceKeypoint.new
  89. colkp=ColorSequenceKeypoint.new
  90. bcol=BrickColor.new
  91.  
  92. RS:UnbindFromRenderStep('Anim')
  93.  
  94. --player specific...
  95. player = game:service'Players'.LocalPlayer
  96. character = player.Character
  97. torso = character.Torso
  98. head = character.Head
  99. rarm = character['Right Arm']
  100. larm = character['Left Arm']
  101. rleg = character['Right Leg']
  102. rleg = character['Left Leg']
  103. human = character.Humanoid
  104.  
  105. --Utilities... who needs them?
  106.  
  107. function recurseHum(what)
  108. local res
  109. local p=what
  110. if what:IsA'Humanoid'then
  111. res=what
  112. else
  113. repeat
  114. p=p.Parent
  115. if p then
  116. local hum=p:FindFirstChild'Humanoid'
  117. if hum then
  118. res=hum
  119. break
  120. end
  121. end
  122. until p==nil
  123. end
  124. return res
  125. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement