Why is my Double Health gamepass code not working

Anyone know why this is not working?

--[[

-- DonaldDuck5150 --

]]

local ID = 0

local MarketplaceService = game:GetService("MarketplaceService")

function processReceipt(receiptInfo)

	local Player = game:GetService("Players"):GetPlayerByUserId(receiptInfo.PlayerId)

	if not Player then

		return Enum.ProductPurchaseDecision.NotProcessedYet

	end

	local ProductName = "Double Health!"

	print(Player.Name .. " Purchased " .. ProductName)

	MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(plr, ido, purchased)

		if purchased and ido == ID then

			plr.Character.Humanoid.MaxHealth = 200  

			task.wait(0.1)

			plr.Character.Humanoid.Health = 200

			task.wait(0.1)

		end

	end)

	game.Players.PlayerAdded:Connect(function(plr)

		plr.CharacterAdded:connect(function(char)

			if MarketplaceService:UserOwnsGamePassAsync(game.Players[char.Name].UserId, ID) then

				char.Humanoid.MaxHealth = 200  

				task.wait(0.1)

				char.Humanoid.Health = 200

			end

		end)

	end)

end

You have the ID variable at 0

I know that lol I took the gamepass ID out when I made the post

You’re not calling for the ProcessReceipt function anywhere! How is it supposed to run then?

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