Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Dev Product: Pay to teleport not working ?

So basically I want to make this dev product so when you click on the GUI, you pay and then you teleport to the position I've set. What's wrong with it?

local MarketplaceService = Game:GetService("MarketplaceService")
local buyButton = game.StarterGui.TextButton
local productId = 22416362

buyButton.MouseButton1Click:connect(function()
MarketplaceService:PromptProductPurchase(player, productId)
end)

function Click()
script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(-161.5, 465.8, 35.5) -- Position numbers go here.
end

script.Parent.MouseButton1Down:connect(Click)

3 answers

✓ Accepted answer

You need to handle the purchase, look at the developer products tutorial on wiki.roblox.com and find the sample place.

2 comments

0

thanks! got it to work :)

0

good for you! I was stuck forever on that and then I found out there is a difference between PromptProductPurchase and PromptPurchase, lol :P

Honestly , your code looks good I don't know why it isn't working? But anyways look for mistakes I guess! Good job man!

1 comment

0

I don't know why it is not working, I need help.

Thanks guys I fixed it :D

--Thread closed--

1 comment

0

How did you fix it? Please i need to know for my game!

This discussion is preserved as it was. New answers, comments, and votes are closed.