Advertisement
Sungmingamerpro13

Food Stock 2

Jun 23rd, 2024 (edited)
640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.69 KB | None | 0 0
  1. local Model = script.Parent
  2. local Food = Model:WaitForChild("Cupcake")
  3. local Part = Model:WaitForChild("PartTransparency")
  4.  
  5. local Maxnumber = 50
  6.  
  7. Model.StockGui.stockLabel.Text = "STOCK: "..Maxnumber
  8.  
  9. Model.ClickDetector.MouseClick:Connect(function(player)
  10.    
  11.     game.ServerStorage.Foods.Cupcake:Clone().Parent = player.Backpack
  12.     Maxnumber = Maxnumber - 1
  13.  
  14.     Model.StockGui.stockLabel.Text = "STOCK: "..Maxnumber
  15.    
  16.     while wait() do
  17.         if Maxnumber == 0 then
  18.             Maxnumber = 50
  19.             wait(1)
  20.             break
  21.         end
  22.     end
  23. end)
  24.  
  25. Model.ClickDetector.MouseHoverEnter:Connect(function()
  26.     Part.Transparency = 0.5
  27. end)
  28.  
  29. Model.ClickDetector.MouseHoverLeave:Connect(function()
  30.     Part.Transparency = 1
  31. end)
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement