Advertisement
Sungmingamerpro13

SelectBox(Click) with Money

Nov 28th, 2022 (edited)
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 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.MouseHoverLeave:Connect(function()
  12. if script.Parent:FindFirstChild("SelectionBox") then
  13. script.Parent.SelectionBox:Destroy()
  14. end
  15. end)
  16.  
  17. script.Parent.ClickDetector.MouseClick:Connect(function(player)
  18. if player.Money.Value >= 5 then
  19. game.ServerStorage.Foods.Sandwich:Clone().Parent = player.Backpack
  20. end
  21. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement