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

Developer Product Teleport Script Not Working?

Asked by
Rynappel 212 Moderation Voter
5 years ago

So basically I have created a script when you click apart, is prompts the purchase of a developer product and then if you purchase it, it should teleport you. But it doesn't work. Can somebody tell me what I've done wrong? Please help me! (my script:

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)

Answer this question