Please help me, how can I detect that a player has bought my gamepass id in script Script :
local productId = 1233982215
local player = game.Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
script.Parent.MouseButton1Click:connect(function()
print('Click was detected! GG!')
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, productId)
end)
local productId = 1233982215
local player = game.Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
script.Parent.MouseButton1Click:connect(function()
print('Click was detected! GG!')
--game:GetService("MarketplaceService"):PromptGamePassPurchase(player, productId)
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(plr, id, purchased)
if purchased and id == productId then
print("lo tienes :D")
end
end)
end)
I already bought the gamepass but it does not detect the print, what happens?
is local script btw
local productId = 1233982215
local player = game.Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(plr, id, purchased)
if purchased and id == productId then
print("lo tienes :D")
end
end)
script.Parent.MouseButton1Click:connect(function()
print('Click was detected! GG!')
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, productId)
end)
I already have the gamepass purchased, but nothing comes out in the output just
print(‘Click was detected! GG!’)
but why
doesn’t it come out
print(“lo tienes :D”)
?
sorry i am using translator