Hi there.
I have recently been working on a game. I made a gamepass shop and unsurprisingly it did not work.
local market = game:GetService("MarketplaceService")
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
if market:UserOwnsGamePassAsync(plr.UserId, 12886155) then
market:PromptGamePassPurchase(plr.UserId, 12886155)
else
market:PromptGamePassPurchase(plr.UserId, 12886155)
market.PromptGamePassPurchaseFinished:Connect(function()
game:GetService("ReplicatedStorage").Carpet:FireServer()
end)
end
end)
That is my code which is is a localscript. The gamepass is on sale and nothing seems to be wrong in the config but in game I get the error Unable to cast value to Object. When bought, it is meant to send a remote event but it is not even prompting!
Everything is fine in my explorer too.
