I'm trying to make a brick that, when it is clicked, prints "Game Pass" if the user owns the game pass or otherwise prompts the user to buy the game pass. This is what I have; however, unfortunately, it doesn't work:
script.Parent.Click.MouseClick:Connect(function(player)
if player then
local owns = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player, 00000)
if owns then
print("Game Pass")
else
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, 00000)
end
end
end)
I get the following error when calling the UserOwnsGamePassAsync function: "Unable to cast Instance to int64"
Any help would be greatly appreciated!

4 comments
This works, thank you! However, why is it that, when working with a brick that is touched, I can define player in the following manner and not have to include the ".UserId" portion? player = game.Players:GetPlayerFromCharacter(hit.Parent)
Because MarketplaceService uses UserIds. GetPlayerFromCharacter gets a Player, an Instance, from the player's character. Also please mark it as answered :)
I apologize for the trouble, but where do I mark your question as answered? This is my first question on the site haha.
I never asked a question before, not sure lol.Uhh can you keep checking for it? It should be somewhere visible