So, I’m currently trying to make an obby game, now I’ve just finished the GUI for buying gamepass, the gamepass is like Gravity Coil, Speed Coil, and others. but I have a problem. when I tried to buy the Gravity Coil Gamepass, it was purchased but didn’t go into inventory.
I have entered the gamepassId correctly.
This is my first time topic, so i’m sorry if i have a mistake
I Think the reason it’s not going in the player’s inventory is because you have to clone the tool and move it into the player’s backpack if they own the gamepass.
Here’s an example:
--GravityCoilScript
local mps = game:GetService("MarketplaceService")
local gamepassId = script.GamepassID.Value
mps.PromptGamePassPurchaseFinished:Connect(function(plr,passId,purchased)
if purchased then
script.GravityCoil:Clone().Parent = plr.Backpack
end
end)
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function()
local ownsPass = mps:UserOwnsGamePassAsync(plr.UserId,gamepassId)
if ownsPass then
script.GravityCoil:Clone().Parent = plr.Backpack
end
end)
end)