Here's the script:
local webhookURL = "" --There is a webhook, I'm just not showing it.
local HttpService = game:GetService("HttpService")
local Players = game:GetService("Players")
game.ReplicatedStorage.ModEvents.BanPlayerLogs.OnServerEvent:Connect(function(player, Evidence, Username, Reason)
local thumbnail = Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.AvatarBust, Enum.ThumbnailSize.Size420x420)
if game.JobId == "" then
serverId = "N/A"
else
serverId = tostring(game.JobId)
end
local data =
{
["content"] = "",
["embeds"] = {{
["title"] = "",
["type"] = "rich",
["color"] = tonumber(0xFF0000),
["thumbnail"] = {
["url"] = tostring(thumbnail)
},
["fields"] = {
{
["name"] = "**Player**",
["value"] = string.format("%s | %s", player.Name, player.UserId),
},
{
["name"] = "**Action**",
["value"] = "Banned Player.",
},
{
["name"] = "**Info**",
["value"] = "Player banned: "..Username.."\n \nBanned by admin: "..player.Name.."\n \nReason: "..Reason,
},
{
["name"] = "**Evidence**",
["value"] = Evidence,
},
{
["name"] = "**Server ID**",
["value"] = serverId,
},
}
}}
}
local jsonData = HttpService:JSONEncode(data)
HttpService:PostAsync(webhookURL, jsonData)
end)
In the output, it says: "HTTP 400 (Bad Request)"

1 comment
Try using ["avatar_url"] = "http://www.roblox.com/Thumbs/Avatar.ashx?x=150&y=150&Format=Png&username="..plr.Name