Advertisement
Sungmingamerpro13

ToolScript (stacks + Amount)

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