Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Model = script.Parent
- local Food = Model:WaitForChild("Cupcake")
- local Part = Model:WaitForChild("PartTransparency")
- local Maxnumber = 50
- Model.StockGui.stockLabel.Text = "STOCK: "..Maxnumber
- Model.ClickDetector.MouseClick:Connect(function(player)
- game.ServerStorage.Foods.Cupcake:Clone().Parent = player.Backpack
- Maxnumber = Maxnumber - 1
- Model.StockGui.stockLabel.Text = "STOCK: "..Maxnumber
- while wait() do
- if Maxnumber == 0 then
- Maxnumber = 50
- wait(1)
- break
- end
- end
- end)
- Model.ClickDetector.MouseHoverEnter:Connect(function()
- Part.Transparency = 0.5
- end)
- Model.ClickDetector.MouseHoverLeave:Connect(function()
- Part.Transparency = 1
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement