Discord Log System

I want to make a discord system in which if someone uses a speed hack it will kick them then send a discord message. The kick system does work but the send discord message is not working.
This is the script I have in SSS

local WebhookURL = "https://discord.com/api/webhooks/xxxxx/xxxxx
local Discord = game.ReplicatedStorage.Discord

local HTTP = game:GetService(“HttpService”)

function Discord.OnServerInvoke(player, msg)

local msg = player.Name…" Has been kicked for exploiting/hacking"

local payload = HTTP:JSONEncode({
content = msg,
username = player.Name
})

HTTP:PostAsync(WebhookURL, payload)
return “Kicked”
end

The script I have in Starter Player Script is

local Players = game:GetService(“Players”)
local LocalPlayer = Players.LocalPlayer
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local remoteEvent = ReplicatedStorage:WaitForChild(“Discord”)

repeat wait() until LocalPlayer.Character

while true do
wait()
if LocalPlayer.Character.Humanoid.WalkSpeed ~= 16 then
LocalPlayer:Kick(“Speed Exploiting”)
remoteEvent:FireServer()
wait(10)
end
end

I don’t understand what is wrong. Also I put webhook as XXX bc its better to be not revealed

An exploiter would just delete your script and they could also fire your remote with a custom message, rethink your solution to the problem. You should be validating the player’s movement from the server

Uhmmm… Can you tell me how to fix the script first?

local payload = HTTP:JSONEncode({
["content"] = msg,
["username"] = player.Name
})

you could try this…

or just copy the webhook part of this script:

I believe you should be using :InvokeServer instead of :FireServer when using a remote function.

2 Likes

If I am correct, this should be :InvokeServer instead of :FireServer since it is a remote function. You can also use the output console to see your error.