Hello, Basically I have made a gamepass button within the gui and i test in server and when I press the button, it prompts and I purchase it, the problem is if I press it again it prompts again and doesnt give me my item . I have already check that it is the right gamepass id and have check if everything works fine. I believe it has to do with caching because a few minutes later it works. So is there a faster way to cache gamepass prompt and check if i have it?
Localscript in button:
local GiveBoomBox = game:GetService("ReplicatedStorage").Events:WaitForChild("BoomBox")
BoomBox = game.Players.LocalPlayer.Backpack:FindFirstChild("BoomBox")
function click()
print(BoomBox)
if BoomBox == game.Players.LocalPlayer.Backpack:FindFirstChild("BoomBox") and game:GetService("MarketplaceService"):UserOwnsGamePassAsync(script.Parent.Parent.Parent.Parent.UserId, 5143841) then
print("Boombox was nil")
GiveBoomBox:FireServer()
print(BoomBox)
print("Boombox fired")
elseif BoomBox ~= game.Players.LocalPlayer.Backpack:FindFirstChild("BoomBox") and game:GetService("MarketplaceService"):UserOwnsGamePassAsync(script.Parent.Parent.Parent.Parent.UserId, 5143841) then
print("Already Have it")
else
game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, 5143841)
end
end
script.Parent.MouseButton1Down:connect(click)
Script in ServerScriptService:
game.ReplicatedStorage.Events.BoomBox.OnServerEvent:Connect(function(player)
local Boombox = game.ServerStorage:FindFirstChild("BoomBox")
Boombox:Clone().Parent = player.Backpack
end)

5 comments
do you have the boombox on your inventory?
The boombox is in serverstorage and gets move to the backpack as I do not want it in starterpack.
Congratulations, you trusted the client and you were robbed.
a hacker can just do GiveBoomBox:FireServer() and get the boombox, add serverside check instead
same issue as with your other thread, you don't actually get the gamepass when you buy it in studio, it just fires PromptGamePassPurchaseFinished