Advertisement
TheUnknownDiscord

Untitled

Oct 1st, 2021 (edited)
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. tool = Instance.new("Tool")
  2. tool.Name = "heal"
  3. healzone = Instance.new("Part")
  4. healzone.Name = "Handle"
  5. healzone.Parent = tool
  6. tool.Parent = owner.Character
  7. healzone.Size = Vector3.new(10, 10, 10)
  8. healzone.Massless = true
  9. healzone.Transparency = 0.5
  10. healing = false
  11. inrange = false
  12. tool.Activated:connect(function()
  13. healing = true
  14. end)
  15. local healwho
  16. function humanoidnotrange()
  17. healwho = nil
  18. inrange = false
  19. end
  20. local Trail3
  21. function humanoidinrange(otherPart)
  22. local partParent = otherPart.Parent
  23. local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
  24. if humanoid then
  25. if humanoid ~= owner.Character.Humanoid then
  26. inrange = true
  27. healwho = humanoid
  28. healroot = humanoid.RootPart
  29. startheal()
  30. end
  31. end
  32. end
  33. db = 0
  34. function startheal()
  35. if healing then
  36. local attachment0 = Instance.new("Attachment", healzone)
  37. local attachment1 = Instance.new("Attachment", healroot)
  38. Trail3 = Instance.new("Trail")
  39. Trail3.Name = "trail"
  40. Trail3.Parent = healzone
  41. Trail3.Attachment0 = attachment0
  42. Trail3.Attachment1 = attachment1
  43. Trail3.MinLength = 0.1
  44. Trail3.MaxLength = math.huge
  45. Trail3.Lifetime = 3.5
  46. Trail3.LightInfluence = 1
  47. Trail3.Color = ColorSequence.new(Color3.new(0.49, 0.041, 0.79),Color3.new(0.49, 0.041, 0.79))
  48. Trail3.FaceCamera = true
  49. elseif not healing then
  50. db = db + 1
  51. if db ~= 2 then
  52. Trail3:Destroy()
  53. wait(0.5)
  54. db = 0
  55. end
  56. end
  57. while inrange do
  58. wait(0.25)
  59. if healing then
  60. if healwho then
  61. if healwho.Health <= 100 then
  62. healwho.Health = healwho.Health + 1
  63. end
  64. end
  65. end
  66. end
  67. end
  68.  
  69. tool.Deactivated:Connect(function()
  70. healing = false
  71. healwho = nil
  72. end)
  73. healzone.Touched:Connect(humanoidinrange)
  74. healzone.TouchEnded:Connect(humanoidnotrange)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement