Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tool = Instance.new("Tool")
- tool.Name = "heal"
- healzone = Instance.new("Part")
- healzone.Name = "Handle"
- healzone.Parent = tool
- tool.Parent = owner.Character
- healzone.Size = Vector3.new(10, 10, 10)
- healzone.Massless = true
- healzone.Transparency = 0.5
- healing = false
- inrange = false
- tool.Activated:connect(function()
- healing = true
- end)
- local healwho
- function humanoidnotrange()
- healwho = nil
- inrange = false
- end
- local Trail3
- function humanoidinrange(otherPart)
- local partParent = otherPart.Parent
- local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
- if humanoid then
- if humanoid ~= owner.Character.Humanoid then
- inrange = true
- healwho = humanoid
- healroot = humanoid.RootPart
- startheal()
- end
- end
- end
- db = 0
- function startheal()
- if healing then
- local attachment0 = Instance.new("Attachment", healzone)
- local attachment1 = Instance.new("Attachment", healroot)
- Trail3 = Instance.new("Trail")
- Trail3.Name = "trail"
- Trail3.Parent = healzone
- Trail3.Attachment0 = attachment0
- Trail3.Attachment1 = attachment1
- Trail3.MinLength = 0.1
- Trail3.MaxLength = math.huge
- Trail3.Lifetime = 3.5
- Trail3.LightInfluence = 1
- Trail3.Color = ColorSequence.new(Color3.new(0.49, 0.041, 0.79),Color3.new(0.49, 0.041, 0.79))
- Trail3.FaceCamera = true
- elseif not healing then
- db = db + 1
- if db ~= 2 then
- Trail3:Destroy()
- wait(0.5)
- db = 0
- end
- end
- while inrange do
- wait(0.25)
- if healing then
- if healwho then
- if healwho.Health <= 100 then
- healwho.Health = healwho.Health + 1
- end
- end
- end
- end
- end
- tool.Deactivated:Connect(function()
- healing = false
- healwho = nil
- end)
- healzone.Touched:Connect(humanoidinrange)
- healzone.TouchEnded:Connect(humanoidnotrange)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement