Sungmingamerpro13

ToolScript (stacks + Uses)

Jun 24th, 2025 (edited)
789
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.80 KB | None | 0 0
  1. Tool = script.Parent
  2.  
  3. player = game.Players.LocalPlayer
  4. Frame = player.PlayerGui:WaitForChild("BackpackGui").Frame
  5.  
  6. Tool.usesValue:GetPropertyChangedSignal("Value"):Connect(function()
  7.     Frame.usesLabel.Text = "Uses: "..Tool.usesValue.Value
  8. end)
  9. Frame.usesLabel.Text = "Uses: "..Tool.usesValue.Value
  10.  
  11. Tool.Activated:Connect(function()
  12.     if Tool:WaitForChild("usesValue") and Tool.usesValue.Value > 1 then
  13.         Tool.usesValue.Value -= 1
  14.     else
  15.         if Tool:WaitForChild("stacks") and Tool.stacks.Value > 1 then
  16.             Tool.stacks.Value -= 1
  17.            
  18.             Tool.usesValue.Value = 3
  19.         else
  20.             Tool:Destroy()
  21.             Frame.usesLabel.Visible = false
  22.         end
  23.     end
  24. end)
  25.  
  26. Tool.Equipped:Connect(function()
  27.     Frame.usesLabel.Visible = true
  28.    
  29.    
  30. end)
  31.  
  32. Tool.Unequipped:Connect(function()
  33.     Frame.usesLabel.Visible = false
  34. end)
  35.  
Advertisement
Add Comment
Please, Sign In to add comment