Checking for ownership
PlayerOwnsAsset, when used in LocalScripts, will return live results from the ROBLOX website. Therefore, no matter when he purchases the item, it will return the most recently updated value.
01 | local MarketplaceService = game:GetService( 'MarketplaceService' ) |
02 | local ProductId = 12345 |
04 | game.Players.PlayerAdded:connect( function (player) |
05 | if MarketplaceService:PlayerOwnsAsset(player, ProductId) then |
07 | local stat = Instance.new( 'NumberValue' ) |
09 | stat.Parent = player [ 'path to leaderstats folder' ] |
Closed as Not Constructive by evaera
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?