Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Tool = script.Parent
- player = game.Players.LocalPlayer
- Frame = player.PlayerGui:WaitForChild("BackpackGui").Frame
- Tool.Amount:GetPropertyChangedSignal("Value"):Connect(function()
- Frame.usesLabel.Text = "Uses: "..Tool.Amount.Value
- end)
- Frame.usesLabel.Text = "Uses: "..Tool.Amount.Value
- Tool.Activated:Connect(function()
- if Tool:WaitForChild("Amount") and Tool.Amount.Value > 1 then
- Tool.Amount.Value -= 1
- else
- if Tool:WaitForChild("stacks") and Tool.stacks.Value > 1 then
- Tool.stacks.Value -= 1
- else
- Tool:Destroy()
- Frame.usesLabel.Visible = false
- end
- end
- end)
- Tool.Equipped:Connect(function()
- Frame.usesLabel.Visible = true
- end)
- Tool.Unequipped:Connect(function()
- Frame.usesLabel.Visible = false
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement