I’m already using a TextBox and .ProcessReceipt. This is my code so far, but for some reason the server script can’t read what the player has written, how do I fix this?
local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local function processReceipt(receiptInfo)
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
-- The player probably left the game
-- If they come back, the callback will be called again
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if receiptInfo.ProductId == 1155551830 then
local player = Players:FindFirstChild(Players:GetNameFromUserIdAsync(receiptInfo.PlayerId))
print(Players:FindFirstChild(Players:GetNameFromUserIdAsync(receiptInfo.PlayerId)).PlayerGui.MainGui.MenuFrame.QuestionFrame.ScrollingFrame.TextBox.Text)
-- when i try to print the above line ^^ it returns empty string, even though on the client i already wrote some text, why is that happening?
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
MarketplaceService.ProcessReceipt = processReceipt