Gravity Coil Game pass Not Working?

I am trying to make a gravity coil game pass but I am facing a lot a trouble.

  1. I am trying to make it so that when you press the image button you buy the game pass and get the item.

  2. When I press the image button it prompts the purchase like expected but when I buy it it gives me nothing.
    My Problem Video

  3. I tried watching tutorials on YouTube but they unfortunately it did not help me and when I took a thorough search on the forum but I did not see anything that would help me.

So if anyone know what I can do in these codes to make it work please help.

local player = game.Players.localPlayer
local button = script.Parent
local MarketplaceService = game:GetService("MarketplaceService")

script.Parent.MouseButton1Click:Connect(function()
	MarketplaceService:PromptGamePassPurchase(player,17590407)
end)
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local gamePassID = 17590407

function Spawned(player)

	local HasGamepass = false

	local success, message = pcall(function()
		HasGamepass = MarketplaceService:UserOwnsGamePassAsync(player.userId, gamePassID)
	end)

	if not success then
		warn("Checking In Player Has Gamepass" .. tostring(message))
		return
	end

	if HasGamepass == true then
		game.ServerStorage.GravityCoil:Clone().Parent = player.Backpack  --Change GravityCoil To Your Tool/Gear Name
	end 
end

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function()
		Spawned(player)
	end)
end)

Players.PlayerSpawned:Connect(Spawned)
1 Like

It should work actually, did you try resetting your character after the purchase?

No, So should I? Well Everything Is worth a shot.

Did you place the coil in serverstorage?

1 Like

I just reset my character and I still did not get it.

For some reason I think the problem is with the game pass because when I buy it I don’t get it.

The name of you tool should be GravityCoil if it’s not then change the tool name to “GravityCoil” and it should be placed in ServerStorage.

1 Like

image
I Put it there and Its name is “GravityCoil”

Well anyway thanks for trying to help for now I will just go and Try different things.

Yup, I was right I made a new game pass and it worked and now when I buy it gives me the item.