Why is one of my gamepasses not working?

Hi Developer

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

2 Likes

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)

Screenshot (268)

2 Likes

wow, you’re right. I was clone the tool and move it into the player’s backpack, and thank’s to help my gamepass problem

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.