Http 400 (Not sending Embed)

I can’t find out where I am going wrong. Everything else but the embed. When it tries to does Error (HTTP 400 (Bad Request))
I have been trying for around 2 to 3 hours no luck. So, I am asking for help before start pulling my hair out.

local ReplicatedStorage = game.ReplicatedStorage
wait(1)
local debounce = false
ReplicatedStorage.ExploitLog.OnServerEvent:Connect(function(plr,ID,reason,reason)
	print("player:"..plr.Name) -- Attemped find error but nothing
print("ID:"..ID) -- Attemped find error but nothing
	print("Reason:"..reason) -- Attemped find error but nothing
	if  debounce == false then debounce = true
	 for _,player in pairs(game.Players:GetPlayers()) do
		if player ~= plr then
				game.ReplicatedStorage.ExploitKicked:FireClient(player,"Exploiter Kicked", "Exploiter: ".. tostring(plr).."\n Reason: "..reason) 
			end 
			wait(0.1)
			debounce = false	
local webhook = ''
local HttpService = game:GetService("HttpService")
local data = {
		["username"] = "Exploit logs",
		["embeds"] = {{
			["title"] = "Exploiter Kicked!",
			["color"] = tonumber(0xffffff),
			["fields"] = {
				{
					["name"] = "Exploiter Player Information:",
					["value"] = "Below",
					["inline"] = false
				},
				{
					["name"] = "Exploiter Player Username:",
					["value"] = plr.Name,
					["inline"] = true
				},
				{
					["name"] = "Exploiter Player ID (UserId)",
					["value"] = ID.UserId,
					["inline"] = true
				},
				{
					["name"] = "Reason:",
					["value"] = reason,
					["inline"] = false
					}
				}
		}
		
		}}
local newdata1 = HttpService:JSONEncode(data)
HttpService:PostAsync(webhook, newdata1) 
end end end)

Assuming your web hook isn’t actually “” in your game, nothing pops out at me at first glance. Is HttpEnabled on in your game?

Correct, HttpEnabled is Enabled. I have another webhook that works perfectly with the same format, but it’s for a totally different system. I am just honestly lost.

Wicked weird. I am not super knowledgeable on Http requests, but it seems pretty clear that there isn’t any sort of formatting error within your scripts and all functions seem to be called correctly. Could this perhaps be an external error, such as your encoded data not properly matching the accepted data from whatever webhook you are using (I assume discord)?

Discord is correct. Let me test the same webhook on a different working script.

Now a it is saying Error 404 a different script…

Umm… You are trying to get UserId property of ID value which propably doesn’t exist. Change this and maybe this should help.

It was correct at first.
(30 characters)

WAIT! You made just told me something

This ID.UserId is not correct because this Value is propably a Number which doesn’t have UserId property. Change this to plr.UserId and check if this works

That part was messed up with fire server
image
Before; It said Id was my username. But same thing.

I don’t see the error…

image

Oh… HTTP404. Maybe you didn’t set the webhook url?

Wait that is new… (30 characters)

It worked!!!
image

Noice. Btw. This is my first time I helped someone.

1 Like

You did an amazing job! Keep up the good work! :slight_smile:

1 Like