I was making a gamepass for my game and I have litteraly no idea how to sence it. I already have the shop and everything I am just wanting to know how to make it work.
https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/UserOwnsGamePassAsync
1 | if game:GetService 'MarketplaceService' :UserOwnsGamePassAsync(UserId, gamepassId) then |
2 | print 'player has gamepass' |
3 | end |
if that does not work try this
01 | game.Players.PlayerAdded:Connect( function (player) |
02 |
03 | local GamepassID = 17441333 |
04 |
05 | local start 1 = Instance.new( "BoolValue" ) |
06 | start 1. Name = "start1" |
07 | start 1. Parent = player |
08 | start 1. Value = false |
09 |
10 | if game:GetService( "MarketplaceService" ):UserOwnsGamePassAsync(player.UserId,GamepassID) then |
11 | start 1. Value = true |
12 | end |
13 | end ) |