Issue With Gamepass Script

So I’m working on an admin panel, but to buy premium, for example, you can buy a game pass. Only my script that reads if the game pass has actually been purchased does not work.

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

if MarketplaceService:UserOwnsGamePassAsync(plr, GamepassId) then
	print("Test")
end

Greets,
@Sealiteq

3 Likes

player.UserId

local MarketplaceService = game:GetService("MarketplaceService")
local GamepassId = 25301828
local payer = game.Players.LocalPlayer

if MarketplaceService:UserOwnsGamePassAsync(payer.UserId, GamepassId) then
	print("Test")
end

more
event might be useful

1 Like