Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

UserOwnsGamePassAsync says I don't own game pass?

When I try to use this script it says I don't own the game pass, witch i do so I don't know what the problem is

if game.MarketplaceService:UserOwnsGamePassAsync(game.Players.LocalPlayer,1669132) then print("Player has gamepass")
else print("player dont got it :(")
 end

1 answer

✓ Accepted answer

Reasons it was not working

You were not getting the users ID, instead, you were getting there name. This is how you should use :UserOwnsGamePassAsync()

:UserOwnsGamePassAsync(UserID,GamePassID)

Also, I recommend using :GetService() when fetching market place.

game:GetService("MarketplaceService")

The fix

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players.LocalPlayer.userId,1669132) then
	print("Player has gamepass")
else
	print("player dont got it :(")
end

This discussion is preserved as it was. New answers, comments, and votes are closed.