in ServerScriptService:
local MarketplaceService = game:GetService("MarketplaceService")
local AnswerBotEvent = game:GetService("ReplicatedStorage"):FindFirstChild("AnswerBotEvent")
game:GetService("ReplicatedStorage"):FindFirstChild("AnswerBotEvent").OnServerEvent:Connect(function(player, bot)
print("bombo")
AnswerBotEvent:FireClient(player)
player:SetAttribute("AnswerNPC", bot:GetFullName())
end)
MarketplaceService.ProcessReceipt = function(receiptInfo)
if receiptInfo.ProductId == 2816056930 then
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
if player then
local bot = game.Workspace:FindFirstChild(player:GetAttribute("AnswerNPC"), true)
if bot then
local dialog = bot.AnswerNPC.Head.Dialog
if dialog then
task.delay(0.1, function()
dialog:Destroy()
end)
local botMessage = Instance.new("BillboardGui")
botMessage.Adornee = bot.Head
botMessage.Size = UDim2.new(2, 0, 2, 0)
botMessage.StudsOffset = Vector3.new(0, 2, 0)
botMessage.Parent = bot.Head
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Text = "The answer is: " .. bot.Value.Value
textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
textLabel.Parent = botMessage
wait(5)
botMessage:Destroy()
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end```