Roblox has recently changed their user-agent so that shouldn’t be the issue (at least it worked a week ago).
Make sure the url you’re passing has http://
or https://
prefix. If it still doesn’t work, try using a proxy like a few people suggested.
Same issue here, but I wasn’t sending a message to discord, I was making a function which checked if an username existed through an user API by sending a request to https://www.roblox.com/UserCheck/DoesUsernameExist?username=EXAMPLE. I got the same error. “Trust check failed”.
That’s because Roblox blocks any HTTP requests to the Roblox website, you’d need to use a proxy service
Oh yes you are right! But ROBLOX should definitely whitelist their APIs.
You can not get any json file data from https://www.roblox.com use proxy to get the file content.
For me heroku
is the best one to use.
Or you can use this proxy link that @Osyris made.
Example code
local HttpService = game:GetService("HttpService");
local Url = "https://discord.osyr.is/api/webhooks/539079934660968495/DbiWa9SHZGPRc_vG8ikruzWcM_rfl2Wj1j9BUydHPnguUv_0HJTYmi-gnWZoZKzg34fg";
local Data= {
username = "vamik64";
content = "From DevForum.";
}
local JSON = HttpService:JSONEncode(Data);
pcall(function()
HttpService:PostAsync(Url,JSON);
end)
Thanks for all your answers, I should be able to try them out later today once I get home. I’ll update it then!
All you have to do is replace discordapp.com
with discord.osyr.is
which is a proxy.
UPDATE
I’m still getting the error. I changed the Discord link to the proxy version.
I solved it! It seems that doing FireServer also takes the first variable of the event (function) as the player firing the event. I just added an extra variable “Player” along with the other two remaining variables. I’m planning on using the Player variable later on anyways!