Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is this a JSON error or not?

Asked by
Validark 1580 Snack Break Moderation Voter
10 years ago
function NewGroup(Child)
GroupStuff=game:GetService("HttpService"):GetAsync("http://api.roblox.com/Groups/"..Child.Value) --when the number value of a group is added
script.String.Value=tostring(GroupStuff[1]) --String is a stringvalue inside the script
end

script.ChildAdded:connect(NewGroup)  --connects when a number value is added

So I tried out this script and it gives me the error: "trust check failed for http://api.roblox.com/Groups/692110"

When you go to the link of a group, it gives you an output that looks like this: {"Name":"Control RTS","Id":1052407,"Owner":{"Name":"Rovien","Id":1579768},"EmblemUrl":"http://www.roblox.com/asset/?id=172090617","Description":"? Game Page ?\r\nLink to Control's game page:\r\nhttp://www.roblox.com/--place?id=93139508\r\n\r\n? Trello Board ?\r\nCheck for upcoming features and bug fixes:\r\nhttps://trello.com/b/aYlSNnfv/control\r\n\r\n? Unofficial Wiki ?\r\nCheck for general documentation on the game:\r\nhttp://controlrts.wikia.com/wiki/ControlRTS_Wiki","Roles":[{"Name":"General Populus","Rank":5},{"Name":"Main Players","Rank":150},{"Name":"Admins","Rank":222},{"Name":"Developers","Rank":254},{"Name":"Group Holder","Rank":255}]}

I just need to grab the first part, but I am not entirely sure what is the problem. I have tried modifying the function like so:

function NewGroup(Child)
GroupStuff=game:GetService("HttpService"):GetAsync("http://api.roblox.com/Groups/"..Child.Value)
local Utils = assert(LoadLibrary("RbxUtility")) 
local JSON = Utils.DecodeJSON(GroupStuff)
game.Workspace.GroupNameGet.String.Value=tostring(JSON[1])
end

script.ChildAdded:connect(NewGroup)

Please help! I have been stuck on this for days and tried everything I can.

2 answers

Log in to vote
2
Answered by 10 years ago

You can't access ROBLOX.com directly, instead you'll have to create a website that will send your requests to ROBLOX

I would recommend you set up a website on a free host like 00webhost and then use PHP to forward requests to the ROBLOX website.

Ad
Log in to vote
-1
Answered by
bbissell 346 Moderation Voter
10 years ago

According to ROBLOX, There are two possible reasons you got this error:

--You did not include "http://" or "https://" at the beginning of your URL
--You are trying to access a website that is disallowed, such as http://www.roblox.com/.

However, None of these are applicable. This may be a ROBLOX issue. Contact [email protected] for more support.

Answer this question