So i am Using a webhook to Discord that sends me data when someone purchased a gamepass or when someone donates. Now, I need to Get error info when a Error occured. so i made a script that looks like this:
local url = "https://discordapp.com/api/webhooks/NOTSHOWINGTHEWEBHOOK/XXXXXXXXXXXXXXXXXXXX"
local http = game:GetService("HttpService")
while wait(3) do -- Repeats And tries to detect errors in the script
game:GetService("ScriptContext").Error:Connect(function(msg,stack,source) -- If any error occured
print(msg,stack,source.Name)
local data = {
['embeds'] = {{
['title'] = "Error Occured",
['description'] = msg,stack,source.Name.."" -- Error info
}}
}
local finaldata = http:JSONEncode(data)
http:PostAsync(url, finaldata)
end)
end
But i tested to write something random on a script. it did not give any errors To my discord Server. its placed in the workspace on a serverscript.
This was hard to explain so im sorry for the bad explaining.

3 comments
Try keeping that ServerScript in ServerScriptService
@BestCreativeBoy Im sorry but that did not work. is it anything in the script?
@BestCreativeBoy Im sorry but that did not work. is it anything in the script?