Roblox Gamepass Detection not working

I want to detect when a user has my gamepass.

Current code:

	game.Players.PlayerAdded:Connect(function(player)
			
			local gpassid = 20293253
			
			if game:GetService("GamePassService"):PlayerHasPass(player, 20293253) then 
				print("owned.")

				NameTag.user.Visible = false
				NameTag.disp.Visible = false

				NameTag.vipuser.Visible = true
				NameTag.vipdisp.Visible = true

			else
				print(player.Name .. " doesn't have the game pass...")

			end
			
			end)

TY. Also I am not very good at this so keep it basic.

https://developer.roblox.com/en-us/api-reference/function/GamePassService/PlayerHasPass

Use MarketplaceService:UserOwnsGamePassAsync instead.
https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/UserOwnsGamePassAsync

Ok thank you cody could you provide an example usage for this info please?

[Some example code]

Replace game:GetService("GamePassService"):PlayerHasPass(player, 20293253) with game:GetService('MarketplaceService'):UserOwnsGamePassAsync(player.UserId, gpassid)