-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFreePurchases.lua
More file actions
34 lines (28 loc) · 1.17 KB
/
Copy pathFreePurchases.lua
File metadata and controls
34 lines (28 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
local player = Players.LocalPlayer
local function fire(signalType, id)
pcall(function()
if signalType == "Product" then
MarketplaceService:SignalPromptProductPurchaseFinished(player.UserId, id, true)
elseif signalType == "Gamepass" then
MarketplaceService:SignalPromptGamePassPurchaseFinished(player, id, true)
elseif signalType == "Bulk" then
MarketplaceService:SignalPromptBulkPurchaseFinished(player.UserId, id, true)
elseif signalType == "Purchase" then
MarketplaceService:SignalPromptPurchaseFinished(player.UserId, id, true)
end
end)
end
MarketplaceService.PromptProductPurchaseFinished:Connect(function(plr, id, bought)
fire("Product", id)
end)
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(plr, id, bought)
fire("Gamepass", id)
end)
MarketplaceService.PromptBulkPurchaseFinished:Connect(function(userId, id, bought)
fire("Bulk", id)
end)
MarketplaceService.PromptPurchaseFinished:Connect(function(userId, id, bought)
fire("Purchase", id)
end)