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

Why wont my Developer product teleport the player?

Heres my code, After I buy the Dev product it confirms it and then I dont get teleported

Sever script

local MarketplaceService = game:GetService("MarketplaceService")
local devproductid = 34538597

MarketplaceService.ProcessReceipt = function(receiptInfo)
	for i, player in pairs(game.Players:GetChildren()) do
		if player.userID ==receiptInfo.PlayerId then
			if receiptInfo.ProductId == devproductid then
				local torso = player.Character.Torso
				torso.CFrame = game.Workspace.ControlRoom.TPBlock.CFrame
			end
		end
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
end

This is my Developer Product Handling script in ServerScriptService

Local Script

local button = script.Parent
local devproductid = 34538597

button.MouseButton1Click:connect(function()
	game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, devproductid)
end)

This is my Starter gui button local script

1 comment

0

Any errors in output? Try printing on different lines and see where the script stops and make sure all conditions of if statements are returning true.

2 answers

✓ Accepted answer

player.userID should be player.userId

1 comment

0

Thank you!

This isnt an Answer. But how did you fix it? I need exactly this!

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