Error fetching group info: HttpService is not allowed to access ROBLOX resources - Server - GroupInfoScript:25
local groupId = 34523299
local groupService = game:GetService("GroupService")
local httpService = game:GetService("HttpService")
while wait(5) do
local success, response = pcall(function()
local GroupProx = game.HttpService:GetAsync("https://groups.roblox.com/v1/groups/"..34523299)
game.HttpService:JSONDecode(GroupProx)
return game.HttpService:JSONDecode(GroupProx)
end)
if success and response then
local memberCount = response.memberCount
local emblemUrl = response.emblemUrl
local groupName = response.name
if memberCount and emblemUrl and groupName then
script.Parent.MemberCount.Text = "[LIVE] Members: " .. tostring(memberCount)
script.Parent.GroupImage.Image = emblemUrl
script.Parent.GroupName.Text = groupName
else
print("Error: Received nil value(s) from group info.")
end
else
print("Error fetching group info: " .. tostring(response))
end
end
If you wish to access Roblox api’s from within a Roblox game, you will need to use some kind of proxy. I’m not familiar with the actual proxies that are available, however you should be able to find some pretty easily.
local groupService = game:GetService("GroupService")
local httpService = game:GetService("HttpService")
while wait(5) do
local success, response = pcall(function()
local Http = game:GetService('HttpService')
local Link = "https://patch-zany-curio.glitch.me/?link=groups%2Eroblox%2Ecom%2Fv1%2Fgroups%2F34523299"
local response = Http:GetAsync(Link)
return Http:JSONDecode(response)
end)
if success and response then
local memberCount = response.memberCount
local emblemUrl = response.emblemUrl
local groupName = response.name
if memberCount and emblemUrl and groupName then
script.Parent.MemberCount.Text = "[LIVE] Members: " .. tostring(memberCount)
script.Parent.GroupImage.Image = emblemUrl
script.Parent.GroupName.Text = groupName
else
print("Error: Received nil value(s) from group info.")
end
else
print("Error fetching group info: " .. tostring(response))
end
end