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)
You need to handle the purchase, look at the developer products tutorial on wiki.roblox.com and find the sample place.
Honestly , your code looks good I don't know why it isn't working? But anyways look for mistakes I guess! Good job man!