Guest User

ROBLOX Revive Ability

a guest
Apr 11th, 2017
1,788
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1.  
  2. Services = setmetatable({},{__index=function(s,r) return game:service(r) end})
  3. Player = Services.Players.LocalPlayer
  4.  
  5.  
  6. wait()script.Parent=nil
  7. BodyParts={}
  8. abs = function(int)
  9. if int < 0 then return -int else return int end
  10. end
  11. rad = function(deg)
  12. return deg * math.pi / 180
  13. end
  14. deg = function(rad)
  15. return rad * 180 / math.pi
  16. end
  17. dist = function(p1,p2)
  18. r,e = ypcall(function()
  19. p1 = p1.Position
  20. end)
  21. if not r then p1 = p1 end
  22. r,e = ypcall(function()
  23. p2 = p2.Position
  24. end)
  25. if not r then p1 = p1 end
  26. return math.sqrt( (p2.X-p1.X)^2 + (p2.Y-p1.Y)^2 + (p2.Z-p1.Z)^2 )
  27. end
  28.  
  29.  
  30.  
  31.  
  32.  
  33. function GetHum()
  34. for i,v in pairs(GetChar():children'') do
  35. if v.ClassName == 'Humanoid' then
  36. return v
  37. end
  38. end
  39. end
  40.  
  41. function GetChar()
  42. return Player.Character
  43. end
  44.  
  45. function Died()
  46. for i,v in pairs(GetChar():children'') do
  47. if v.ClassName == 'Part' then
  48. table.insert(BodyParts,{v.CFrame,v})
  49. elseif v.ClassName == 'Hat' then
  50. v.Parent=workspace
  51. table.insert(BodyParts,{v.Handle.CFrame,v.Handle,1})
  52. end
  53. end
  54.  
  55. wait(3)
  56. for i,v in pairs(BodyParts) do
  57. v[2].Anchored=true
  58. if v[2].Name == 'Torso' then pos = v[1] end
  59. end
  60.  
  61. for i,v in pairs(BodyParts) do
  62. coroutine.resume(coroutine.create(function()
  63. repeat Services.RunService.Heartbeat:wait()
  64. v[2].CFrame = v[2].CFrame:lerp(v[1],.1)
  65. until dist(v[2],v[1]) < .05
  66. v[2].CFrame=v[1]
  67. end))
  68. end
  69. end
  70.  
  71. Player.CharacterAdded:connect(function(char)
  72. char:WaitForChild('Torso')
  73. for i,v in pairs(BodyParts) do
  74. if v[3] then
  75. v[2]:Remove()
  76. end
  77. end
  78. BodyParts={}
  79. char.Torso.CFrame=pos or CFrame.new(0,12,0)
  80. GetHum().Died:connect(Died)
  81. end)
  82. GetHum().Died:connect(Died)
  83. print'rannering'
Advertisement
Add Comment
Please, Sign In to add comment