whys this script not working? it prompts the purchase but once purchased it does nothing…
local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PRODUCT_ID = 3317388711
script.Parent.Touched:Connect(function(hit)
local player = Players:GetPlayerFromCharacter(hit.Parent)
if player and hit.Name == "HumanoidRootPart" then
MarketplaceService:PromptProductPurchase(player, PRODUCT_ID)
end
end)
local function processreceipt(receiptInfo)
print("receipt processing")
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
print(receiptInfo.ProductId,PRODUCT_ID)
if receiptInfo.ProductId == PRODUCT_ID then
print("setting true")
ReplicatedStorage.Events.GuaranteedSecret.Value = true
return Enum.ProductPurchaseDecision.PurchaseGranted
end
return Enum.ProductPurchaseDecision.NotProcessedYet
end
MarketplaceService.ProcessReceipt = processreceipt