I tried using a tutorial on yt on how to make a gui that when pressed, gives the player an option to buy a gamepass. its not working tho. I put the script inside a textbutton, which is inside a screen gui. "Give" Is a remote event in rep store. pls help.
local mps = game:GetService("MarketplaceService")
local gamepass_id = ______
script.Parent.MouseButton1Click:Connect(function()
local player = game.Players.Localplayer
mps:PromptGamePassPurchase(player, gamepass_id)
end)
mps.PromptGamePassPurchaseFinished:connect(function(player, id, purchased)
if id == gamepass_id and purchased then
game.ReplicatedStorage.Give:fireserver()
end
end)
maybe its outdated?

2 comments
Use :FireServer() instead of :fireserver().
This wouldn't work because you need to connect a remote function to a remote event