Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local drink = script.Parent.Parent.abc
- local spot = script.Parent.Parent.Holder
- local db = false
- moneyToGive = 100
- debounce = false
- function onClick(click)
- debounce = false
- script.Parent.ClickDetector.MouseClick:connect(function(hit)
- if debounce == true then
- return
- end
- player = hit
- if player == nil then
- return
- end
- stat = player:findFirstChild("leaderstats")
- if stat == nil then
- return
- end
- cash = stat:findFirstChild("Cash")
- if cash == nil then
- return
- end
- if cash.Value < 1 then -------- IF MONEY <1 THEN RETURN ? LOOKS LIKE IT WORK BUT I CAN STILL PRESS THE BUTTON
- return
- end
- debounce = true
- cash.Value = cash.Value - moneyToGive -------- GIVE MONEY
- wait()
- debounce = false
- end)
- if db == false then
- db = true
- local d = drink:clone() -------- CLONE THE DRINK WHEN BUTTON PRESS
- d.Handle.Position = spot.Position
- d.Parent = game.Workspace
- d.Handle.Anchored = false
- d.Name = "7up"
- wait(5)
- db = false
- end
- end
- script.Parent.ClickDetector.MouseClick:connect(onClick)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement