You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
Make my darn webhooks work in-game
What is the issue? Include screenshots / videos if possible!
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried soo many darn solutions I could find on dev forum, none of them work, and the last post I made about this was no use of help at all.
Script 1:
local HttpService = game:GetService("HttpService")
ReplicatedStorage = game.ReplicatedStorage
script.Parent.Changed:Connect(function()
if script.Parent.Occupant then
local plr = game.Players:FindFirstChild(script.Parent.Occupant.Parent.Name)
if plr then
local new = script.Parent.ScreenGui:Clone()
new.Parent = plr.PlayerGui
new.Enabled = true
end
end
end)
function LogToDiscord(user, signed)
local success = pcall(function()
local data = {
["content"] = user.Name .. " has "..signed.." the Recruit Desk! (BY SIGNING YOUR NAME BELOW, YOU ARE AGREEING TO TERMS OF GIVING YOUR SERVICE TO THE USMC AND EVERYTHING YOU DO WILL BE WATCHED DURING THIS COURSE OF TRAINING).";
["username"] = user.Name;
["avatar_url"] = game.Players:GetUserThumbnailAsync(user.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size100x100);
}
HttpService:PostAsync("https://discord.osyr.is/api/webhooks/869301241291894875/xxxxxxxxxxxxxxxxxxxxxxxxx-Iu-QV0BN2yvHTHez_IVzVBJp33s6qterrOSphyY_C-O6c", HttpService:JSONEncode(data))
end)
end
ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(user)
if user then
LogToDiscord(user, "signed")
end
end)
I don’t get how it doesn’t work?!
My other scripts don’t seem to log to my discord as well via webhook, and HTTPS is enabled.
First of all, don’t show your webhook link.
Also, I don’t think username and avatar_url are fields, so put your stuff in content.
If that doesn’t work then just try running the PostAsync alone with proper arguments.
username and avatar_url are fields, because this used to work a few months ago when I used these scripts for a game, so it must be roblox that broke them lol
And if I take a free modeled webhook script from public, some of them are around 2019-2021 date and use avatar_url and they work when I test those public webhooks, which proves my point.
--[[
Thank you for getting this! Put this script in Adonis_Loader > Config > Plugins
Don't forget to fill in the variables below!
]]
local WebhookURL = "https://discord.osyr.is/api/webhooks/xxxxxxxxxxxxxx/0-fCe_GkBu8436xGVLxFcqQHMkpjZ-Y4wc5IRcNdPQwUq0TbMMX6OWkp2FHPeykeso3A" -- Put this with your full Webhook URL
--[[
Do not edit below this unless you know what you are doing!
Made by happxiier - Contact happxiier#6085 if you have any concerns!
]]
server = nil
service = nil
local PlaceName = game:GetService('MarketplaceService'):GetProductInfo(game.PlaceId).Name
local HTTPS = game:GetService("HttpService")
return function()
service.Events.CommandRan:Connect(function(player, Data)
local Level = nil
local command = nil
local success = nil
for i,v in pairs(Data) do
if i == "Success" then
success = v
end
if i == "Message" then
command = v
end
if type(v) == "table" then
for e,n in pairs(v) do
if e == "Level" then
if n == 4 then
Level = "Creator"
elseif n == 3 then
Level = "Owner"
elseif n == 2 then
Level = "Admin"
elseif n == 1 then
Level = "Mod"
else
Level = "Player"
end
end
end
end
end
local WebhookMessage = {
["username"] = "Admin Logs",
["avatar_url"] = "https://cdn.discordapp.com/attachments/748517845117173850/780294630499549184/remxz_company_logo.png",
["content"] = "",
["embeds"] = {{
["title"] = "",
["description"] = "",
["type"] = "rich",
["color"] = tonumber(0xffffff),
["fields"] = {
{
["name"] = "User",
["value"] = tostring(player.Name),
["inline"] = false
},
{
["name"] = "Admin Level",
["value"] = tostring(Level),
["inline"] = true
},
{
["name"] = "Command",
["value"] = tostring(command),
["inline"] = false
},
{
["name"] = "Timestamp",
["value"] = tostring(service.GetTime()),
["inline"] = false
},
{
["name"] = "Game",
["value"] = "["..tostring(PlaceName).."](https://www.roblox.com/games/"..(tostring(game.PlaceId))..")",
["inline"] = false
},
}
}
}
}
WebhookMessage = HTTPS:JSONEncode(WebhookMessage)
if success then
HTTPS:PostAsync(WebhookURL, WebhookMessage)
end
end)
end
So I removed local success = pcall(function(), and it gave me HttpError: DnsResolve when I activate the alarms which then completely breaks the whole script.
It looks like you are using Osryis’s proxy server. From their post it says that the service is shutting down. Are you sure you are using a correct domain?
Also, it looks like you are sending the request to discord.com and getting 400 Bad Request. are you sure you are following the API and sending to the correct URL/giving right arguments?
local HttpService = game:GetService("HttpService")
ReplicatedStorage = game.ReplicatedStorage
script.Parent.Changed:Connect(function()
if script.Parent.Occupant then
local plr = game.Players:FindFirstChild(script.Parent.Occupant.Parent.Name)
if plr then
local new = script.Parent.ScreenGui:Clone()
new.Parent = plr.PlayerGui
new.Enabled = true
end
end
end)
function LogToDiscord(user, signed)
local success = pcall(function()
local data = {
["content"] = user.Name .. " has "..signed.." the Recruit Desk! (BY SIGNING YOUR NAME BELOW, YOU ARE AGREEING TO TERMS OF GIVING YOUR SERVICE TO THE USMC AND EVERYTHING YOU DO WILL BE WATCHED DURING THIS COURSE OF TRAINING).";
["username"] = user.Name;
["avatar_url"] = "https://www.roblox.com/bust-thumbnail/image?userId="..user.UserId.."&width=100&height=100&format=png"
}
HttpService:PostAsync("https://discord.osyr.is/api/webhooks/869301241291894875/xxxxxxxxxxxxxxxxxxxxxxxxx-Iu-QV0BN2yvHTHez_IVzVBJp33s6qterrOSphyY_C-O6c", HttpService:JSONEncode(data))
end)
end
ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(user)
if user then
LogToDiscord(user, "signed")
end
end)
is the last line of code within the embed before the closing } for it to work. It should end up looking like this: https://gyazo.com/88755f6d81b218194769679ceca1490d This code will make the Profile Picture of the Webhook on Discord a snippet of the Player’s Roblox Avatar.
Thank you, please reply to me if you have any further issues!