Advertisement
Guest User

SHIELD2

a guest
Apr 4th, 2020
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2.  
  3. local healingCircle = script.Parent
  4.  
  5. local coolDown = .1
  6. local healthPercentage = .3
  7.  
  8. for _, plr in next, Players:GetPlayers() do
  9.     if plr.Character ~= nil and plr.Character:FindFirstChild("Tag") ~= nil then
  10.         local center = ...
  11.        
  12.         local radius = 8
  13.  
  14.         local Character = plr.Character
  15.         local Humanoid = Character:FindFirstChild("Humanoid")
  16.        
  17.         local HRP = Character:FindFirstChild("HumanoidRootPart")
  18.        
  19.         while wait(coolDown) do
  20.             center = healingCircle.Position
  21.            
  22.             if (center - Vector3.new(HRP.Position.X, 0, HRP.Position.Z)).magnitude <= radius then
  23.                 if Humanoid then
  24.                     Humanoid.Health = Humanoid.Health + Humanoid.MaxHealth * healthPercentage/100
  25.                 end
  26.             end
  27.         end
  28.     end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement