How would I check if the player has bought the gamepass, like when you click buy, and you pay for it, it says something like: Congrats, you own ‘…’
You check who has boughtpasses for your group games in revenue in the sales tab.
I think your looking for something like this, if I’m not wrong?
local MarketplaceService = game:GetService("MarketplaceService")
local Player = game:GetService("Players")
local GamepassId = 0 -- id here
if MarketplaceService:UserOwnsGamePassAsync(Player.UserId, GamepassId) then
print("Gamepass owned.")
end
I mean like when you buy it, the game checks itself
local MarketplaceService = game:GetService("MarketplaceService")
local ProductId = 0 -- ID of your product
local PurchaseEvent = game.YourPathToRemoteEvent
MarketplaceService.ProcessReceipt = function(productInfo)
local buyer = game:GetService('Players'):GetPlayerByUserId(productInfo.PlayerId)
if productInfo.ProductId == productId1 then
-- Code here, like firing your RemoteEvent to make the client show your "congratulations UI"
end
end
Tell if this does or doesn’t work so I can work out a better solution.
So what I need it to do is when you buy it, it says congratculations and then it never shows again. If I write script.Parent.Visible = true will it only show once (After I tween it off)