I tried using this simple serverscript:
wait(1) hs = game:GetService("HttpService") name = "https://api.roblox.com/users/get-by-username?username=" name = (name.."Roytt") test = hs:GetAsync(name, true) print(test)
but I get the error prsented in the title. I'm not sure what's wrong.
There is no problem with your code. Roblox just blocks all traffic from HTTP Service to the roblox website.
Long story short, you are not allowed to access the roblox websites from HTTP Service in game.
Short story long, you can't access roblox websites with HttpService, but you can use this website https://rprxy.xyz/ to go to the roblox page you were trying to access with http service. If you use this site, you would simply change it from roblox.com to rprxy.xyz
wait(1) hs = game:GetService("HttpService") name = "https://api.rprxy.xyz/users/get-by-username?username=" name = (name.."Roytt") test = hs:GetAsync(name, true) print(test)
This code would go to the roblox proxy site and get the requested information. This is a good way to access anything on the roblox pages that roblox doesn't allow you to access. Here is a link to the HttpService wiki.
I hope this answered your question. If it did please accept this as the answer, if it didn't feel free to ask any questions you have. If you have any other non-related questions feel free to ask those too.