You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I Would like to add Player Name & Player thumbnail to this webhook. -
What is the issue? Include screenshots / videos if possible!
I was able to add some basic info like price, product name but cant seem to add player name next to userid. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Found one similar topic but didn’t help, I successfully use other webhooks that include these fields without a problem and have also tried to adapt the script to it but failed.
Here is the script I need adjusted and below is a similar one that already works.
Thanks in advance!
productName = "Dev Product"
ProductId = 0000
Price = "$90"
MarketplaceService = game:GetService("MarketplaceService")
HTTPService = game:GetService("HttpService")
Webhook_URL = " "
MarketplaceService.PromptProductPurchaseFinished:Connect(function(userid, id, ifpurchased)
if ifpurchased then
local Data = {
["content"] = "",
["embeds"] = {{
["title"] = userid , -- title
["description"] = " has purchased: " .. productName,
["type"] = "rich",
["color"] = tonumber(0xff0065), --any hex colour code
["fields"] = {
{
["name"] = Price, --name of field, eg mine is Feedback
["value"] = ifpurchased, -- change to your text
["inline"] = true
}
}
}}
}
Data = HTTPService:JSONEncode(Data)
HTTPService:PostAsync(Webhook_URL, Data)
end
end)
What I need for the one above is to function like the one below
local url = " "
local http = game:GetService("HttpService")
script.Parent.MouseClick:Connect(function(player)
local data = {
['embeds'] = {{
['title'] = "" .. player.Name .. "",
['description'] = "Clicked: " .. " "..Part.." " ,
["color"] = tonumber(0xFFFAFA),
['fields'] = {
{
['name'] = " Account Age",
["value"] = player.AccountAge,
['inline'] = true
},
{
['name'] = " User ID",
['value'] = player.UserId,
['inline'] = true
},
},
["image"] = {
['url'] = "https://www.roblox.com/Thumbs/Avatar.ashx?x=250&y=250&username=" .. player.Name,
}
}},
['avatar_url'] = "https://www.roblox.com/Thumbs/Avatar.ashx?x=250&y=250&username=" .. player.Name,
}
local finaldata = http:JSONEncode(data)
http:PostAsync(url, finaldata)
end)