Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is there a way to detect if a game doesn't have Studio Access to API Services?

I've got a Plugin which is heavily dependent on Studio being able to access the API Services is there a way to detect this being disabled and then I can prompt the user to turn it on or the Plugin won't work?

Does this have to do with this?

game.HttpRbxApiService

5 comments

0

It will automatically tell the User that the API Service isn't enabled if a call fails.

0

I know that it has an error in Output but I mean to detect it disabled and then I can show a little UI at the corner saying the plugin wont work since its disabled

0

maybe try using pcall and get the service in the pcall. then you could do "if not service then" to see if the service is fetched

0

or not

0

I explained how to use pcall() in my answer.

2 answers

HttpRbxApiService is a modified version of HttpService used by Roblox Admins.

We can find out if code is properly run using the pcall() function. To find out if http service works, try this in studio:

local hs = game:GetService("HttpService")
local success,fail = pcall(function()
	hs:PostAsync("http://www.google.com")
end)
if success and not fail then
	print("Http works!")
else
	print("Something went wrong!")
end

If this helped, accept the answer so we both get reputation! :)

2 comments

0

I'll give it a try

0

See message below for problem I've incountered with this.

I've given your answer a go but it appears it's just triggering as failed each time even if the API Services have access see screenshot below.

Screenshot

Here is a screenshot of the error note I added my custom error message and it was still doing the same even without my custom error message.

Screenshot

1 comment

0

Are you connected to the internet?

This discussion is preserved as it was. New answers, comments, and votes are closed.