What's wrong with this code?
So, I'm trying to force a Prompt Purchase, if someone doesn't have a gamepass, but if they do, they can access a place.
I've finished my code, but it just doesn't want to work.
01 | service = game:GetService( "MarketplaceService" ) |
02 | teleportService = game:GetService( "TeleportService" ) |
06 | game.Players.PlayerAdded:connect( function (onPlayer) |
07 | if service:PlayerOwnsAsset(onPlayer, gamepass) then |
08 | teleportService:Teleport(placeID, onPlayer) |
10 | service:PromptPurchase(onPlayer, gamepass) |