local webhook = "--Discord link here"
local http = game:GetService("HttpService")
local WebhookFunction = game.ReplicatedStorage.ACBAN
function WebhookFunction.OnServerEvent(player, ID, Reason, System)
local data = {
embeds = {{
title = "Anti-Exploit";
description = "Player Banned!";
color = 8376188;
fields = {
{
name = "Player Name";
value = player.Name
};
{
name = "Player User ID";
value = player.UserId
};
{
name = "Reason";
value = "Exploiting"
};
{
name = "Anti-Cheat And Webhook made by Mystery_Devx & NotTheAverageUser1";
value = System
}
}
}}
}
local transmit = http:JSONEncode(data)
http:PostAsync(webhook,transmit)
end
I’m assuming that the script couldn’t know if it was an event of the remote event. Connect a function using Connect, and then the parameters that came from the remote event will automatically be perceived.
I modified it a little and I come with this error now:
game.Players.PlayerAdded:Connect(function(player)
local webhook = "--webhook link"
local http = game:GetService("HttpService")
local WebhookFunction = game.ReplicatedStorage.BanEvent
local player = game.Players.PlayerAdded:Connect(function(player)
local ID = player.UserId
function WebhookFunction()
local data = {
embeds = {{
title = "Anti-Exploit";
description = "Player Banned!";
color = 8376188;
fields = {
{
name = "Player Name";
value = player.Name
};
{
name = "Player User ID";
value = player.UserId
};
{
name = "Reason";
value = "Exploiting"
}
}
}}
}
local transmit = http:JSONEncode(data)
http:PostAsync(webhook,transmit)
end
WebhookFunction()
game.ReplicatedStorage.BanEvent.OnServerEvent:Connect(function(WebhookFunction)
end
end)
lets go back to the original script you made, firstly thats not how to connect remoteevents on the server, i thought this was a function inside a modulescript ^
local webhook = "--Discord link here"
local http = game:GetService("HttpService")
local WebhookFunction = game.ReplicatedStorage.ACBAN
WebhookFunction.OnServerEvent:Connect(function(player, ID, Reason, System) -- see where this is going? Connecting events will always be in this format, i can't really explain it properly but the gist is thsi is how to connect remoteevents to a function
local data = {
embeds = {{
title = "Anti-Exploit";
description = "Player Banned!";
color = 8376188;
fields = {
{
name = "Player Name";
value = player.Name
};
{
name = "Player User ID";
value = player.UserId
};
{
name = "Reason";
value = "Exploiting"
};
{
name = "Anti-Cheat And Webhook made by Mystery_Devx & NotTheAverageUser1";
value = System
}
}
}}
}
local transmit = http:JSONEncode(data)
http:PostAsync(webhook,transmit)
end)