Advertisement
Sungmingamerpro13

ToolScript

Mar 11th, 2025
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.59 KB | None | 0 0
  1. local Tool = script.Parent;
  2.  
  3. enabled = true
  4.  
  5. function onActivated()
  6.     if not enabled  then
  7.         return
  8.     end
  9.  
  10.     enabled = false
  11.  
  12.     wait(.8)
  13.  
  14.     local Humanoid = Tool.Parent:FindFirstChild("Humanoid")
  15.     local EatAnimTrack = Humanoid:LoadAnimation(script.Parent.EatAnimation)
  16.    
  17.     if (Humanoid ~= nil) then
  18.         if (Humanoid.MaxHealth > Humanoid.Health + 1.6) then
  19.             Humanoid.Health = Humanoid.Health + 1.6
  20.         else   
  21.             if Humanoid.Health == Humanoid.MaxHealth then
  22.                 EatAnimTrack:Play()
  23.                 Tool:Destroy()
  24.             end
  25.         end
  26.     end
  27.  
  28.     enabled = true
  29.  
  30. end
  31.  
  32. script.Parent.Activated:connect(onActivated)
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement