MarketplaceService Error

Basically, i have this script:

local plr = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")

local gid = 20202695

while wait(1) do
	if mps:UserOwnsGamepassAsync(plr.UserId, gid) then
		script.Parent.TextTransparency = 0
	end
end

And i’m getting this error on the output:

The text transparency is still not being set to 0, basically that error is making it not work.

Does anyone know what’s wrong?

This error is popping up because the function is called UserOwnsGamePassAsync, with a capital P for pass.

By the way, I wouldn’t recommend calling that function each second - that might be too much for APIs. Instead, I would check to see if the user owns the gamepass when the script launches, and if they don’t own the gamepass, connect a function to PromptGamePassPurchaseFinished, which will fire when the player buys the gamepass.

1 Like