local passId = 7046842
script.Parent.ClickDetector.MouseClick:connect(function(player)
Game:GetService("MarketplaceService"):PromptPurchase(player, passId)
end)
✓ ANSWER ACCEPTED
How to make it onplayertouch instead?
1 answer
✓ Accepted answer
local passId = 7046842
function touch(hit)
local player = hit.Parent
local plr = game.Players:GetPlayerFromCharacter(player)
if player:FindFirstChild("Humanoid") and plr then
Game:GetService("MarketplaceService"):PromptPurchase(plr, passId)
end
end
script.Parent.Touched:Connect(touch)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
I'm not sure what you mean... like when the character makes contact with the part?
You need to be more specific, I dont understand what you're asking for