I'm trying to make it have cooldown, something wrong with my debounce...
local productId = script.Parent.Id.Value
local player = game.Players.LocalPlayer
debounce = false
if debounce == false then
script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(receiptInfo)
if receiptInfo.ProductId == productId then
while true do
for i = 600,0,-1 do
script.Parent.Text = i
wait(0.1)
if i <= 0 then
local h = Instance.new("Hint",workspace)
h.Text = "Over!"
end
end
end
debounce = true
wait(600)
end
end
end)
end
debounce = false
