Help With Marketplace Prompt Script

I’m trying to make it so there’s a purchase prompt on the players screen when the proximity prompt triggers, but for some reason it wont work and the first line of the function wont print. I tried pathing the player different ways but nothing is happening. This is the code.

local proximity = script.Parent.ProximityPrompt
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local player = Players:GetPlayerByUserId(game.Players.LocalPlayer.UserId)
local productId = 13600173502

local function promptpass()
	print("Prompting Purchase")
	MarketplaceService:PromptProductPurchase(player, productId) 
end

proximity.Triggered:Connect(promptpass)
1 Like

you need make this thing in server you cant use local player on server script


local proximity = script.Parent.ProximityPrompt
local MarketplaceService = game:GetService("MarketplaceService")
local productId = 13600173502

function promptpass(player)
	print("Prompting Purchase")
	MarketplaceService:PromptProductPurchase(player, productId) 
end

proximity.Triggered:Connect(function(player)
promptpass(player)
end)

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