I need help finding what is wrong with this script. Errors that I don't know how to fix

local module = {}

local Players = game:GetService(“Players”)
local HttpService = game:GetService(“HttpService”)
local ServerStorage = game:GetService(“ServerStorage”)
local URL = “”;

module.SendWebhook = function(conentTable)
if not tostring(conentTable[3]) then return end
local data = {
[“content”] = “:warning: New report”;
[“embeds”] = {{
[“author”] = {
[“name”] = tostring(conentTable[1]);
[“icon_url”] = “https://www.roblox.com/headshot-thumbnail/image?userId="..Players:GetUserIdFromNameAsync(tostring(conentTable[1]).."&width=150&height=150&format=png
};
[“description”] = “**”…tostring(conentTable[1])…" has reported: “…tostring(conentTable[2])…”";
[“color”] = tonumber(0xffffff);
[“fields”] = {
{
[“name”] = “Report User”;
[“value”] = tostring(conentTable[2]);
[“inline”] = true;
};
{
[“name”] = “Reason”
[“value”] = tostring(conentTable[3]);
[“inline”] = true;
};
{
[“name”] = “Account Age”
[“value”] = Players:GetPlayerByUserId(tonumber(conentTable[4])).AccountAge…" days";
[“inline”] = true;
};
{
[“name”] = “Game ID”
[“value”] = tostring(ServerStorage.JoinCode.Value);
[“inline”] = true;
};

		};
		["footer"] = {
			["icon_url"] = "";
			["text"] = "Developed by OnlyBaconsNotSalads"
		}
	}}
}
HttpService:PostAsync(URL, HttpService:JSONEncode(data))

end

return module

Just a heads up I’d recommend redacting your webhook URL here, hooks.hyra uses your actual webhook URL concatenated with there base url, so you basically just leaked your own webhook. Anyways, that aside, can you provide any error message you’ve gotten from trying to use this?

I haven’t ran it yet, and thanks for telling me out of the webhook, I am going to change it. I will definitely run it soon though.


Ran the game, this is what I got.

Try this

local module = {}

local Players = game:GetService("Players")
local HttpService = game:GetService("HttpService")
local ServerStorage = game:GetService("ServerStorage")
local URL = ""

module.SendWebhook = function(conentTable)
  if not tostring(conentTable[3]) then return end
  local data = {
    ["content"] = ":warning: New report";
    ["embeds"] = {{
      ["author"] = {
        ["name"] = tostring(conentTable[1]);
        ["icon_url"] = "https://www.roblox.com/headshot-thumbnail/image?userId="..Players:GetUserIdFromNameAsync(tostring(conentTable[1])).."&width=150&height=150&format=png"
      };
      ["description"] = "**"..tostring(conentTable[1]).." has reported: "..tostring(conentTable[2]).."**";
      ["color"] = tonumber(0xffffff);
      ["fields"] = {
        {
          ["name"] = "Report User";
          ["value"] = tostring(conentTable[2]);
          ["inline"] = true;
        };
        {
          ["name"] = "Reason"
          ["value"] = tostring(conentTable[3]);
          ["inline"] = true;
        };
        {
          ["name"] = "Account Age"
          ["value"] = Players:GetPlayerByUserId(tonumber(conentTable[4])).AccountAge.." days";
          ["inline"] = true;
        };
        {
          ["name"] = "Game ID"
          ["value"] = tostring(ServerStorage.JoinCode.Value);
          ["inline"] = true;
        };
      };
      ["footer"] = {
        ["icon_url"] = "";
        ["text"] = "Developed by OnlyBaconsNotSalads"
      }
    }}
  }
  HttpService:PostAsync(URL, HttpService:JSONEncode(data))
end

return module

1 Like

Still has an error but thank you for trying.