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