Advertisement
HowToRoblox

SafeZoneHandler

Apr 19th, 2020
5,001
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. local hitbox = script.Parent
  2.  
  3.  
  4. hitbox.Touched:Connect(function(touch)
  5.    
  6.    
  7.     local char = touch.Parent
  8.    
  9.     if game.Players:GetPlayerFromCharacter(char) then
  10.        
  11.        
  12.         if char:FindFirstChild("Humanoid") then
  13.            
  14.             char.Humanoid.MaxHealth = math.huge
  15.             char.Humanoid.Health = math.huge
  16.         end    
  17.     end
  18. end)
  19.  
  20.  
  21. hitbox.TouchEnded:Connect(function(touch)
  22.    
  23.    
  24.     local char = touch.Parent
  25.    
  26.     if game.Players:GetPlayerFromCharacter(char) then
  27.        
  28.        
  29.         if char:FindFirstChild("Humanoid") then
  30.            
  31.             char.Humanoid.MaxHealth = 100
  32.             char.Humanoid.Health = 100
  33.         end    
  34.     end
  35. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement