hi, i was working at an anti exploing script and i want when a player exploits to be kicked, but he every time is kicked but not how i want, i want to kick the player and send a message to discord to know that player exploited. The Script:
local ServerId = "I don't give it"
local HttpService = game:GetService("HttpService")
local function Hacker(plr,TypeOfHack)
local message = 'the player named '..plr.Name..' exploited. The exploit he used: '..TypeOfHack..'. He was kicked. '..plr.Name.."'s Data: {Name: "..plr.Name..", UserId: "..plr.UserId..'}'
local data = {
name = 'Exploit bot';
internalMessage = message;
image = game.Players:GetUserThumbnailAsync(plr.UserId,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size180x180);
}
local Succes,Error = pcall(function()
data = HttpService:JSONEncode(data)
HttpService:PostAsync(ServerId,data,Enum.HttpContentType.ApplicationJson,true)
end)
if not Succes then
warn(Error)
end
plr:Kick('Exploit: '..TypeOfHack)
end
Well you need to post to a discord hook and not the server id. Also that request is bad, here is the doccumentation for the JSON needed to post to a webhook. Also, the webhook link is fine. Just make sure you are doing HttpService:PostAsync(“https://discordapp.com/api/webhooks/”, data)