Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Dev Product: Pay to teleport not working ?

Asked by
RoyMer 301 Moderation Voter
9 years ago

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

Log in to vote
1
Answered by 9 years ago

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

0
thanks! got it to work :) RoyMer 301 — 9y
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 dragonkeeper467 453 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

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

0
I don't know why it is not working, I need help. RoyMer 301 — 9y
Log in to vote
0
Answered by
RoyMer 301 Moderation Voter
9 years ago

Thanks guys I fixed it :D

--Thread closed--

0
How did you fix it? Please i need to know for my game! Rynappel 212 — 5y

Answer this question