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