Advertisement
Sungmingamerpro13

Food Stocks

May 6th, 2024
799
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.76 KB | None | 0 0
  1. local Food = script.Parent
  2.  
  3. local Stock = 100
  4.  
  5. Food.CashGui.stockLabel.Text = "Stock: "..Stock
  6.  
  7. Food.ClickDetector.MouseClick:Connect(function(player)
  8.     if player.Coins.Value >= 150 then
  9.         player.Coins.Value = player.Coins.Value - 150
  10.  
  11.         Stock = Stock - 1
  12.  
  13.         Food.CashGui.stockLabel.Text = "Stock: "..Stock
  14.  
  15.         if not player.Backpack:FindFirstChild("Cupcake") then
  16.             game.ServerStorage.Foods.Chips:Clone().Parent = player.Backpack
  17.         end
  18.     else
  19.         Food.CashGui.cashLabel.Text = "Insufficient Coins"
  20.         wait(2)
  21.         Food.CashGui.cashLabel.Text = "100 Coins"
  22.     end
  23. end)
  24.  
  25. Food.ClickDetector.MouseHoverEnter:Connect(function()
  26.     Food.SelectionBox.Visible = true
  27. end)
  28.  
  29. Food.ClickDetector.MouseHoverLeave:Connect(function()
  30.     Food.SelectionBox.Visible = false
  31. end)
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement