Acknowledgements! I’m Sam, a solo scripter, UI designer and builder. As well as GFX. I am attempting to make a payment center for my game, and I need help with my script which I want it to do this.
- Send a log of the player
- Send how much the person, bought via the price;
Current script that I have:
[Server script:]
game.ReplicatedStorage.events.secondaary.OnServerEvent:Connect(function(plr, payment)
if payment == "FinalPurchase" then
local Data = {
['embeds'] = {{ --Add a curly bracket here
["title"] = "sam's payment notifier",
["description"] = "hey there matey, you're payment center is going off, ya girl you're rich **cough cough so true**" -- i want to add a field / area where it the administrator to see the price on how much they bought.
}} --Another closing curly bracket
}
Data = httpservice:JSONEncode(Data)
Marketplaceservice.ProcessReceipt = payment
httpservice:PostAsync(order, Data)
end
end)
Basically, the script needs to log, how much they buy and send it to the webhook.
[Local Script]
(manages the purchase and the event)
local MarketplaceService = game:GetService("MarketplaceService")
local plr = game.Players.LocalPlayer
script.Parent.Parent.PaymentCenter.BackgroundFrame.Background.Lowpoly.SmallL.MouseButton1Up:Connect(function()
MarketplaceService:PromptProductPurchase(plr, (1151154861))
wait(7.5)
script.Parent.Parent.PurchaseScreen.MainFrame.Visible = true
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getbuildtype.Text = "Low Poly"
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getbuildsize.Text = "Small"
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getpayment.Text = "5,000"
game.ReplicatedStorage.events.secondaary:FireServer("FinalPurchase")
end)
script.Parent.Parent.PaymentCenter.BackgroundFrame.Background.Lowpoly.MediumL.MouseButton1Up:Connect(function()
MarketplaceService:PromptProductPurchase(plr, (1151154860))
wait(7.5)
script.Parent.Parent.PurchaseScreen.MainFrame.Visible = true
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getbuildtype.Text = "Low Poly"
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getbuildsize.Text = "Medium"
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getpayment.Text = "10,000"
game.ReplicatedStorage.events.secondaary:FireServer("FinalPurchase")
end)
script.Parent.Parent.PaymentCenter.BackgroundFrame.Background.Lowpoly.LargeL.MouseButton1Up:Connect(function()
MarketplaceService:PromptProductPurchase(plr, (1151155019))
wait(7.5)
script.Parent.Parent.PurchaseScreen.MainFrame.Visible = true
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getbuildtype.Text = "Low Poly"
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getbuildsize.Text = "Large"
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getpayment.Text = "15,000"
game.ReplicatedStorage.events.secondaary:FireServer("FinalPurchase")
end)
script.Parent.Parent.PaymentCenter.BackgroundFrame.Background.HighPoly.SmallH.MouseButton1Up:Connect(function()
MarketplaceService:PromptProductPurchase(plr, (1151155020))
wait(7.5)
script.Parent.Parent.PurchaseScreen.MainFrame.Visible = true
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getbuildtype.Text = "High Poly"
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getbuildsize.Text = "Small"
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getpayment.Text = "10,000"
game.ReplicatedStorage.events.secondaary:FireServer("FinalPurchase")
end)
script.Parent.Parent.PaymentCenter.BackgroundFrame.Background.HighPoly.MediumH.MouseButton1Up:Connect(function()
MarketplaceService:PromptProductPurchase(plr, (1151155021))
wait(7.5)
script.Parent.Parent.PurchaseScreen.MainFrame.Visible = true
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getbuildtype.Text = "High Poly"
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getbuildsize.Text = "Medium"
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getpayment.Text = "15,000"
game.ReplicatedStorage.events.secondaary:FireServer("FinalPurchase")
end)
script.Parent.Parent.PaymentCenter.BackgroundFrame.Background.HighPoly.LargeH.MouseButton1Up:Connect(function()
MarketplaceService:PromptProductPurchase(plr, (1151155022))
wait(7.5)
script.Parent.Parent.PurchaseScreen.MainFrame.Visible = true
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getbuildtype.Text = "High Poly"
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getbuildsize.Text = "Large"
script.Parent.Parent.PurchaseScreen.MainFrame.OrderDetailsFrame.getpayment.Text = "20,000"
game.ReplicatedStorage.events.secondaary:FireServer("FinalPurchase")
end)