Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Tool = script.Parent
- local player = game.Players.LocalPlayer
- local QuantityText = player.PlayerGui:WaitForChild("QuantityGui").QuantityText
- Tool:WaitForChild("stacks").Changed:Connect(function(value)
- QuantityText.Text = "Quantity: "..value
- end)
- QuantityText.Text = "Quantity: "..Tool.stacks.Value
- Tool.Activated:Connect(function()
- Tool.stacks.Value -= 1
- while wait() do
- if Tool.stacks.Value == 0 then
- Tool:Destroy()
- player.Character.Humanoid.Health += 5
- QuantityText.Visible = false
- wait(1)
- break
- end
- end
- end)
- Tool.Equipped:Connect(function()
- QuantityText.Visible = true
- end)
- Tool.Unequipped:Connect(function()
- QuantityText.Visible = false
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement