Advertisement
Sungmingamerpro13

ToolScript (Script + Stacks)

Nov 16th, 2024
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.97 KB | None | 0 0
  1. local Tool = script.Parent;
  2.  
  3. enabled = true
  4.  
  5.  
  6.  
  7.  
  8. function onActivated()
  9.     if not enabled  then
  10.         return
  11.     end
  12.  
  13.     enabled = false
  14.     Tool.GripForward = Vector3.new(-.981, .196, 0)
  15.     Tool.GripPos = Vector3.new(-.5, -0.6, -1.5)
  16.     Tool.GripRight = Vector3.new(0, -0, -1)
  17.     Tool.GripUp = Vector3.new(0.196, .981, 0)
  18.  
  19.  
  20.     Tool.Handle.DrinkSound:Play()
  21.  
  22.     wait(.8)
  23.    
  24.     local h = Tool.Parent:FindFirstChild("Humanoid")
  25.     if (h ~= nil) then
  26.         if (h.MaxHealth > h.Health + 1.6) then
  27.             h.Health = h.Health + 1.6
  28.         else   
  29.             h.Health = h.MaxHealth
  30.             Tool.stacks.Value -= 1
  31.         end
  32.     end
  33.  
  34.     Tool.GripForward = Vector3.new(-1, 0, 0)
  35.     Tool.GripPos = Vector3.new(-.5, -.1, 0)
  36.     Tool.GripRight = Vector3.new(0, 0, 1)
  37.     Tool.GripUp = Vector3.new(0,1,0)
  38.  
  39.  
  40.     enabled = true
  41.  
  42.     if Tool.stacks.Value == 0 then
  43.         Tool:Destroy()
  44.     end
  45. end
  46.  
  47. function onEquipped()
  48.     Tool.Handle.OpenSound:play()
  49. end
  50.  
  51. script.Parent.Activated:connect(onActivated)
  52. script.Parent.Equipped:connect(onEquipped)
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement