So in short, I created a gamepass, customized it and copied the ID, then wrote a local script when the player will buy a gamepass:
wait(0.3)
local vipId = 227863941
local button = script.Parent.Parent.DonateGui.gamepasses.VipPass
local player = game:GetService("Players").LocalPlayer
local mps = game:GetService("MarketplaceService")
local function buyVip()
mps:PromptGamePassPurchase(player, vipId)
end
button.MouseButton1Click:Connect(buyVip)
button.TouchTap:Connect(buyVip)
but for some reason, when I press the button, it says this:
I decided to check if the player really has a gamepass, so I wrote this server script:
local mps = game:GetService("MarketplaceService")
local vipId = 227863941
game.Players.PlayerAdded:Connect(function(player)
if mps:PlayerOwnsAsset(player, 227863941) then
print("player has a pass")
else
print("player hasn't a pass")
end
end)
and this is what I got
I admit that I may have written something wrong somewhere because this is my first attempt to work with gamepasses.
P.S. In the end, I want to achieve the following. I have a player in the game who receives cups, I want that without gamepass he gets for example 1 cup, and with gamepass in 2 times more. I would also like that when you leave the game gamepass saved


