Ok so i am working on a public script and i am wondering on how i can check if the game the script is being ran in has HttpsService enabled, the script will need HttpService for some functions and i would like to warn the owner of the problem, all i need help with is to check if the game has HttpsService is enabled. Thanks anyone who awensers.
✓ ANSWER ACCEPTED
How would i check if a game has HttpsService enabled or not?
2 answers
✓ Accepted answer
local HttpService = game:GetService("HttpService")
local CheckHttp = function()
local Set = false
pcall(function()
if HttpService:GetAsync("https://www.test.com/") then
Set = not Set
end
end)
return Set
end
if CheckHttp() then -- returns either true or false
print('works!') else print('uh oh it doesnt work!')
end
Pretty simple actually, pcall comes useful to situations such as these, as JakyeRU said to use pcall. This is an example, hope you learned a thing.
You can use the command bar in Roblox Studio to check if HTTP requests are enabled in a game:
print(game.HttpService.HttpEnabled) -- Returns a boolean determining if HTTP requests are enabled
1 comment
0
That only works in the command bar, i need it in a script
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
I also saw F3X tools with this feature so i know its possible.
Use pcall() when sending a HttpRequest. If it fails, HttpService is disabled. (There might be other reasons too.)