Advertisement
Sungmingamerpro13

Cupcake with Stacks

Mar 28th, 2024 (edited)
738
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.81 KB | None | 0 0
  1. script.Parent.ClickDetector.MouseHoverEnter:Connect(function()
  2.     if not script.Parent:FindFirstChild("SelectionBox") then
  3.         local SelectionBox = Instance.new("SelectionBox")
  4.         SelectionBox.Adornee = script.Parent
  5.         SelectionBox.Parent = script.Parent
  6.         SelectionBox.Color3 = Color3.new(1, 1, 1)
  7.         SelectionBox.Transparency = 0.8
  8.     end
  9. end)
  10.  
  11. script.Parent.ClickDetector.MouseClick:Connect(function(player)
  12.     if player.Money.Value >= 10 then
  13.         player.Money.Value = player.Money.Value - 10
  14.        
  15.         if not player.Backpack:FindFirstChild("Cupcake") then
  16.             game.ServerStorage.Foods.Cupcake:Clone().Parent = player.Backpack
  17.         end
  18.     else
  19.         player.Money.Value = player.Money.Value - 10
  20.  
  21.         if player.Backpack:FindFirstChild("Cupcake") then
  22.             player.Backpack:FindFirstChild("Cupcake").stacks.Value += 1
  23.         end
  24.     end
  25. end)
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement