Checking if the player has bought a game before making it free

Hello.
I want to know if it is possible to check if a player has bought a game before making it free?
Is it possible to do it with MarketplaceService?

1 Like

Absolutely, use this script as a template, to see if the player owns the asset.

local player = game.Players.LocalPlayer
local gameId = 123456

local success, ownsGame = pcall(function()
  return game:GetService("MarketplaceService"):PlayerOwnsAsset(player.UserId, gameId)
end)

if success and ownsGame then
  print("Player has purchased the game")
else
  print("Player has not purchased the game")
end
1 Like

Thank you! I’ll check this out

2 Likes

Just saying, I don’t think gamepassses can be free.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.