Problem with webhook in a remote script

Hi, question i have a script, and i need to fix logs on it but i dont know why it is not working, can you look with me what i do wrong? The webhook url is generated from a proxy https://webhook.lewisakura.moe but still not working

local HttpService = game:GetService("HttpService")
local urlpolitie = "WEBHOOKLINK -WITH PROXY"


game.ReplicatedStorage.JobCreator.Politie.OnServerEvent:Connect(function(plr, Job, Type, plr2, Rank, OldRank)

	if Job == "Politie" then
	if plr:FindFirstChild("WervingStatus").Politie.Value == true then
		if Type == "Aannemen" then
			if game.Players:FindFirstChild(plr2).TeamRanks.Politie.Value == "Administratief / Ondersteunend Personeel" then
				game.Players:FindFirstChild(plr2).TeamRanks.Politie.Value = tostring(Rank)
				game.Players:FindFirstChild(plr2):LoadCharacter()
					local data = {
						['embeds'] = {{
							['title'] = "**WERVING POLITIE LOGGING - DISTRICT UTRECHT**",
							['color'] = 16771928,
							['url'] = "https://www.roblox.com/users/".. plr.UserId .. "/profile",
							['fields'] = {
								{
									['name'] = "Roblox Naam",
									['value'] = tostring(plr2),
									['inline'] = true,
								},
								{
									['name'] = "Werving Lid",
									['value'] = plr.Name,
									['inline'] = true,
								},
								{
									['name'] = "Oude Rank",
									['value'] = tostring(OldRank),
									['inline'] = true
								},
								{
									['name'] = "Nieuwe Rank",
									['value'] = tostring(Rank),
									['inline'] = true
								}
							}
						}}
					}

					local finaldata = HttpService:JSONEncode(data)
					HttpService:PostAsync(urlpolitie, finaldata)
			else
				print("Persoon is al aangenomen")
			end
end)
1 Like

Could you tell us what error is being produced, if there’s any, in the output?

Nope, i dont have some errors. Sometimes only HTTP (404/400)

Replace it with this:

local HttpService = game:GetService("HttpService")
local urlpolitie = "WEBHOOKLINK -WITH PROXY"


game.ReplicatedStorage.JobCreator.Politie.OnServerEvent:Connect(function(plr, Job, Type, plr2, Rank, OldRank)

	if Job == "Politie" then
		if plr:FindFirstChild("WervingStatus").Politie.Value == true then
			if Type == "Aannemen" then
				if game.Players:FindFirstChild(plr2).TeamRanks.Politie.Value == "Administratief / Ondersteunend Personeel" then
					game.Players:FindFirstChild(plr2).TeamRanks.Politie.Value = tostring(Rank)
					game.Players:FindFirstChild(plr2):LoadCharacter()
					local data = {
						['content'] = "",
						['embeds'] = {{
							['title'] = "**WERVING POLITIE LOGGING - DISTRICT UTRECHT**",
							['color'] = tostring(0x16771928),
							['url'] = "https://www.roblox.com/users/".. plr.UserId .. "/profile",
							['fields'] = {
								{
									name = "Roblox Naam",
									value = tostring(plr2),
									inline = true,
								},
								{
									name = "Werving Lid",
									value = plr.Name,
									inline = true,
								},
								{
									name = "Oude Rank",
									value = tostring(OldRank),
									inline = true
								},
								{
									name= "Nieuwe Rank",
									value = tostring(Rank),
									inline = true
								}
							}
						}}
					}

					local finaldata = HttpService:JSONEncode(data)
					HttpService:PostAsync(urlpolitie, finaldata)
				else
					print("Persoon is al aangenomen")
				end
			end
		end
	end
end)

In summary, it removes the dictionary and fixes up the color as it’s supposed to be a string. Also if you believe that the color is incorrect, you can try to look for a converter however it must be in strings.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.