Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- || 📜 AUTHOR: @4zx16 || Donation Board
- ]]
- local Product_Info = {
- ID = 493388249;
- Price = 5;
- Currency = "ROBUX";
- Debounce = true
- }
- local Services = {
- DataStore = game:GetService("DataStoreService"):GetDataStore("Places");
- MarketPlaceService = game:GetService("MarketplaceService")
- }
- local Raised = Services.DataStore:GetAsync(Product_Info.Currency.."_Raised")
- if not Services.DataStore:GetAsync(Product_Info.Currency.."_Raised") then
- Services.DataStore:SetAsync(Product_Info.Currency.."_Raised", 0)
- end
- script.Parent.SurfaceGui.Raised.ROBUX.Text = Product_Info.Currency.." "..Services.DataStore:GetAsync(Product_Info.Currency.."_Raised")
- local function PrintOut(Value)
- print(Value)
- end
- script.Parent.CD.MouseClick:connect(function(Player)
- if Product_Info.Debounce then
- if Player.UserId > 0 then
- print 'Player is not a Guest!'
- Services.MarketPlaceService:PromptProductPurchase(Player, Product_Info.ID)
- end
- end
- end)
- Services.MarketPlaceService.PromptProductPurchaseFinished:connect(function(UserId, ProductId, IsPurchased)
- if Product_Info.Debounce then
- Product_Info.Debounce = false
- if IsPurchased then
- Services.DataStore:IncrementAsync(Product_Info.Currency.."_Raised", Product_Info.Price)
- Services.DataStore:OnUpdate(Product_Info.Currency.."_Raised", PrintOut)
- script.Parent.SurfaceGui.Raised.ROBUX.Text = Product_Info.Currency.." "..Services.DataStore:GetAsync(Product_Info.Currency.."_Raised")
- wait(7)
- end
- Product_Info.Debounce = true
- end
- end)
- coroutine.resume(coroutine.create(function()
- while wait() do
- local Raised = Services.DataStore:GetAsync(Product_Info.Currency.."_Raised")
- script.Parent.SurfaceGui.Raised.ROBUX.Text = Product_Info.Currency.." "..Services.DataStore:GetAsync(Product_Info.Currency.."_Raised")
- end
- end))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement