---------------------------------
-- EVENTS
---------------------------------
local ReportEvent = repStorage.Events:FindFirstChild("Report")
---------------------------------
-- // CODE
---------------------------------
ReportEvent.OnServerEvent:Connect(function(plr, ReportedPlrName, ReportReason)
if debounce then return end
debounce = true
if Players:FindFirstChild(ReportedPlrName) then
local ReportedPlr = Players:FindFirstChild(ReportedPlrName)
local PlayerImage = Players:GetUserThumbnailAsync(plr.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
if ReportedPlr:IsA("Player") then
local data = {
["username"] = "Reports",
["embeds"] = {
{
["title"] = "Player Report",
["description"] = "**Reported Player:** ".. ReportedPlr.Name .. "\n**Reason:** ".. ReportReason .. "\n**Reported by:** ".. plr.Name,
["color"] = 16711680,
["fields"] = {
{
['name'] = "Reporter User ID",
['value'] = tostring(plr.UserId)
},
{
['name'] = "Reported User ID",
['value'] = tostring(ReportedPlr.UserId)
}
},
["footer"] = {
["text"] = "REPORT SYSTEM"
}
}
},
}
local dataToSend = HTTPService:JSONEncode(data)
local success, errorm = pcall(function()
local response = HTTPService:PostAsync(webhookURL, dataToSend, Enum.HttpContentType.ApplicationJson)
end)
if not success then
warn("Failed to send webhook: " .. errorm)
else
print("Webhook sent successfully.")
end
end
end
task.wait(3)
debounce = false
end)
First time firing webhooks. How did I do? (I used the webhook link, no 3rd party as they seem to not work so well).
Response:
Additionally, the local script handling the UI’s button:
---------------------------------
-- SERVICES
---------------------------------
local repStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
---------------------------------
-- UI CONSTANTS
---------------------------------
local button = script.Parent
local ui = button.Parent
local ReportName = ui.User
local ReportReason = ui.Reason
local ReportError = ui.ErrorMsg
local errorPrefix = "ERROR: "
---------------------------------
-- EVENTS
---------------------------------
local ReportEvent = repStorage.Events:FindFirstChild("Report")
---------------------------------
-- // CODE
---------------------------------
local debounce = false
button.Activated:Connect(function()
if debounce then return end
debounce = true
ReportError.Visible = false
ReportError.TextColor3 = Color3.fromRGB(255, 0, 0)
if Players:FindFirstChild(ReportName.Text) and ReportReason.Text ~= nil then
ReportError.TextColor3 = Color3.fromRGB(0, 255, 0)
ReportEvent:FireServer(ReportName.Text, ReportReason.Text)
ReportName.Text = ""
ReportReason.Text = ""
ReportError.Text = "Sent Report!"
ReportError.Visible = true
else
ReportError.Text = errorPrefix .. "Invalid Player Name or Reason!"
ReportError.Visible = true
end
task.wait(3)
debounce = false
ReportError.Visible = false
end)