#ProxmityPrompt Help!

3 messages · Page 1 of 1 (latest)

fluid cosmos
#

here is the script

#

local ProximityPrompt = script.Parent
local MarketplaceService = game:GetService("MarketplaceService")
local ProductId = 1614429071 -- Replace with your actual Developer Product ID

ProximityPrompt.Triggered:Connect(function(player)
local playerId = player.UserId
local hasProduct = false

local success, error = pcall(function()
    hasProduct = MarketplaceService:UserOwnsGamePassAsync(playerId, ProductId)
end)

if success and not hasProduct then
    local success, error = pcall(function()
        player:PromptPurchase(ProductId)
    end)
    if not success then
        warn("Purchase prompt failed: " .. tostring(error))
    end
elseif hasProduct then
    print(player.Name .. " already owns the product.")
end

end)

--1614429071

serene raven
#

What errors are you getting?