Discord Webhook not working?

My discord webhook isnt working. I’ve tried to find the problem, but I haven’t found it yet.

Script:

local ServerScriptService = game:GetService("ServerScriptService")
local HttpService = game:GetService("HttpService")
local _Workspace_ = game:GetService("Workspace")
local Lighting = game:GetService("Lighting")
local Players = game:GetService("Players")

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents")

local BodyParts = {"Left Arm", "Right Arm", "Left Leg", "Right Leg", "Humanoid"}
local WhiteListedStates = {0, 3, 5, 7, 8, 10, 12, 15}

local Webhook = "DISCORD_LINK_HERE"
local EmbedDebounce = false

function SendDiscord(Text)
	if EmbedDebounce == true then return end
	EmbedDebounce = true
	
	local Data = {
		["embeds"] = {{
			["description"] = Text
		}}
	}
	
	local EmbedData = HttpService:JSONEncode(Data)
	HttpService:PostAsync(Webhook, EmbedData)
	wait(0.5)
	EmbedDebounce = false
end

function Disconnect(Player, Text)
	pcall(function()
		RemoteEvents.ChatMessageEvent:FireAllClients(Player.Name.. " was kicked from the game.")
		Player:Kick("Suspected of exploiting.")
	end)
end

RemoteEvents.ClientKick.OnServerEvent:Connect(function(Player, Message)
	pcall(function() SendDiscord(Message) end)
	pcall(function() Player:Kick("Suspected of exploiting.") end)
end)



coroutine.resume(coroutine.create(function()
	while wait(math.random(10, 15)) do
		game:GetService("Workspace").Name = HttpService:GenerateGUID(true)
		game:GetService("Players").Name = HttpService:GenerateGUID(true)
		game:GetService("Lighting").Name = HttpService:GenerateGUID(true)
		game:GetService("ReplicatedFirst").Name = HttpService:GenerateGUID(true)
		game:GetService("ReplicatedStorage").Name = HttpService:GenerateGUID(true)
		game:GetService("ServerScriptService").Name = HttpService:GenerateGUID(true)
		game:GetService("ServerStorage").Name = HttpService:GenerateGUID(true)
		game:GetService("StarterGui").Name = HttpService:GenerateGUID(true)
		game:GetService("Chat").Name = HttpService:GenerateGUID(true)
	end
end))

Lighting:GetPropertyChangedSignal("Ambient"):Connect(function()
	Lighting.Ambient = Color3.fromRGB(138, 138, 138)
end)
Lighting:GetPropertyChangedSignal("OutdoorAmbient"):Connect(function()
	Lighting.OutdoorAmbient = Color3.fromRGB(70, 70, 70)
end)
Lighting:GetPropertyChangedSignal("Brightness"):Connect(function()
	Lighting.Brightness = 2
end)

--[[
-- Note: Keep your ServerScriptService items in folders, and not parent to the service itself.
ServerScriptService.ChildAdded:Connect(function(Child)
	if Child.Name ~= "ChatServiceRunner" then
		pcall(function()
			Child:Destroy()
		end)
	end
end)
-- Note Keep your ReplicatedStorage items in folders.
ReplicatedStorage.ChildAdded:Connect(function(Child)
	if not Child:IsA("Folder") then
		pcall(function()
			Child:Destroy()
		end)
	end
end)
]]

Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		-- Anti Fly
		local Humanoid = Character:WaitForChild("Humanoid")
		local function CheckMagnitude()
			if not Character:FindFirstChild("HumanoidRootPart") then return end
			local PreviousPosition = Character.HumanoidRootPart.Position
			local PreviousState = Humanoid:GetState()
			
			delay(1, function()
				-- Below checks if they have travelled over 25 studs in 1 second. You can edit this.
				if (Character.HumanoidRootPart.Position - PreviousPosition).Magnitude >= 25 then
					wait(0.1)
					if table.find(WhiteListedStates, Humanoid:GetState().Value) or table.find(WhiteListedStates, PreviousState) then return end
					if Humanoid.FloorMaterial ~= Enum.Material.Air or Humanoid.Health == 0 then return end
					Disconnect(Player, Player.Name.." was caught flying.")
				end
			end)
		end
		
		-- Hiding the ClientAntiExploit as best as possible.
		local function CloneClientAntiExploit()
			pcall(function()
				local Descendants = Player:GetDescendants()
				for _, v in pairs(Character:GetDescendants()) do table.insert(Descendants, v) end
				table.remove(Descendants, (table.find(Descendants,Player.PlayerGui)))
				
				local ClonedAntiExploit = script.ClientAntiExploit:Clone()
				ClonedAntiExploit.Name = HttpService:GenerateGUID(true)
				ClonedAntiExploit.Parent = Descendants[math.random(1, #Descendants)]
				ClonedAntiExploit.Disabled = false
				wait(15)
				ClonedAntiExploit:Destroy()
			end)
		end
		coroutine.resume(coroutine.create(function()
			while wait(1) do
				CheckMagnitude()
			end
		end))
		
		coroutine.resume(coroutine.create(function()
			CloneClientAntiExploit()
			while wait(15) do
				CloneClientAntiExploit()
			end
		end))
		
		Humanoid.StateChanged:Connect(function(PreviousState, NewState)
			if NewState == Enum.HumanoidStateType.PlatformStanding then
				Disconnect(Player)
			end
		end)
		Character.ChildRemoved:Connect(function(Child)
			if table.find(BodyParts, Child.Name) then
				Disconnect(Player, Player.Name.."'s"..Child.Name.." was removed.")
			end
		end)
	end)
end)

Local Script:

local Players = game:GetService("Players")
local Player = Players.LocalPlayer

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local _Workspace_ = game:GetService("Workspace")
repeat wait() until game:IsLoaded()

local WhitelistedGuis = {"Chat", "Freecom", "KCoreUI", "ChatInstallVerifier", "LoadingGui", "TouchGui", "TopbarPlus", "BubbleChat", "RbxCameraUI" --[[ Continue typing out other GUIS]]}
local BannedItems = {"BodyGyro", "BodyPosition", "BodyForce", "BodyVelocity", "BodyAngularVelocity", "ModuleScript", "Folder", "Animation"}
local BannedHumanoidStates = {6, 11, 14, 16}

function Disconnect(Message)
	pcall(function()
		ReplicatedStorage.RemoteEvents.ClientKick:FireServer(Message)
		Player:Kick("Suspected of exploiting.")
	end)
end

coroutine.resume(coroutine.create(function()
	while wait(10) do
		pcall(function()
			for _, Child in pairs(Player.PlayerGui:GetChildren()) do
				if table.find(WhitelistedGuis, Child.Name) then return end
				if Child:IsA("LocalScript") or Child.Name == "Dex" then
					Disconnect(Player.Name.. " was caught doing suspicious activity.")
				end
			end
			
			if _Workspace_:GetRealPhysicsFPS() > 60 then
				Disconnect(Player.Name.."'s FPS was higher than the maximum limit.")
			end
		end)
	end
end))

Player.Character:WaitForChild("Humanoid").StateChanged:Connect(function(PreviousState, CurrentState)
	if table.find(BannedHumanoidStates, CurrentState.Value) then
		Disconnect(Player.Name.."'s HumanoidState was unexpectedly changed to "..CurrentState..".")
	end
end)

Player.Backpack.ChildAdded:Connect(function(Child)
	for _, v in pairs(Child:GetDescendants()) do
		if v.Name:lower():find("bt") then
			Disconnect(Player.Name.."was using btools.")
		end
	end
end)

Player.PlayerGui.ChildAdded:Connect(function(Child)
	if not table.find(WhitelistedGuis, Child.Name) then
		Disconnect("A GUI called "..Child.Name.." was inserted into "..Player.Name.."'s PlayerGui.")
	end
end)

Player.Character.DescendantAdded:Connect(function(Descendant)
	if table.find(BannedItems, Descendant.ClassName) then
		Disconnect("A "..Descendant.ClassName.." was unexpectedly inserted into "..Player.Name.."'s character")
	end
end)

You haven’t put the discord webhook link in the appropriate variable…

Make sure HTTP Requests are enabled too

1 Like

I found the problem, I forgot to put SendDiscord(Text) on line 35.
Thanks for the response!

Discord has recently banned any webhook requests from the Roblox API so I assume that’s why.

image
I don’t beleive so, I managed to get it working.

Make sure you dont make too many requests or discord will block it. That’s if you can get it to work at all since pretty sure they try to block all traffic from roblox.

Also this is kinda redundant. just use: workspace (all lower case).

1 Like

Does anyone know why the webhook isn’t working for this part?

if (Character.HumanoidRootPart.Position - PreviousPosition).Magnitude >= 25 then
	wait(0.1)
	if table.find(WhiteListedStates, Humanoid:GetState().Value) or table.find(WhiteListedStates, PreviousState) then return end
	if Humanoid.FloorMaterial ~= Enum.Material.Air or Humanoid.Health == 0 then return end
	Disconnect(Player, Player.Name.." was caught flying.")
end

All the other ones are working.
Edit: Fixed it.

Discord blocked requests from Roblox entirely due to endless abuse of the service from users who don’t know what rate limiting is. Nobody is allowed to make requests from Roblox to Discord anymore.

It’s gonna work until you’re running it on an actual game, currently it’s being sent from your IP, not Roblox’s IP. If you would do it from a gameserver it wouldn’t work. I recommend using a proxy such as Discord Webhook Proxy.

1 Like

Problem:

Solution: