How to get group information

Hello,

Im trying to get all the shirts of my group in a game and make a rig for each of them, i dont need help on that. I need help on how to get the shirts in the first place.
How do i achieve this?

1 Like

I tried setting my own proxy up using this tutorial but i have no success doing so.

My script looks like this:

local responseModule = require(game.ServerStorage.Modules.RetunResponse)

print(responseModule.getasync("https://www.roblox.com/groups/34734276/Tridentz-Clothing#!/about"))

And i tried different types off urls like #!/store etc.

Output: 00:21:45.087 Error fetching data: Unable to fetch - Server - GetGroupShirts:3

I have 0 knowledge on http service and those things, i would like to know what im doing wrong

Try using the following functions, the API ones are the most important:

local function tostringParams(parameters: {[string]: any}): string
	local t = {}
	for k, v in pairs(parameters) do table.insert(t, k.."="..tostring(v)) end
	return table.concat(t, "&")
end

local function getGroupShirtIds(groupId: number, maxResults: number?): {number}
	local maxResults = maxResults or math.huge 
	local parameters = tostringParams({
		category = "Clothing",
		subcategory = "ClassicShirts",
		creatorTargetId = groupId,
		creatorType = "Group",
		limit = 120,
		sortOrder = "Desc",
		sortType = "Updated"
	})
	--proxy this
	local url = "https://catalog.roblox.com/v1/search/items?"..parameters
	local cursor = ""
	local items = {}
	while cursor do
		--pcall this
		local response = game.HttpService:GetAsync(url.."&cursor="..cursor)
		local data = game.HttpService:JSONDecode(response)
		local shouldBreak = false
		for _, item in pairs(data.data) do
			table.insert(items, item.id)
			if #items >= maxResults then
				shouldBreak = true 
				break 
			end
		end
		if shouldBreak then break end
		cursor = data.nextPageCursor
	end
	return items 
end

local function loadShirt(id: number): Shirt?
	--pcall this
	local model = game.InsertService:LoadAsset(id)
	if not model then return nil end
	return model:FindFirstChildWhichIsA("Shirt") 
end

local function getGroupShirts(groupId: number, maxResults: number?): {Shirt}
	local ids = getGroupShirtIds(groupId, maxResults)
	local shirts = {}
	for _, id in pairs(ids) do 
		local shirt = loadShirt(id)
		if not shirt then continue end
		table.insert(shirts, shirt) 
	end
	return shirts 
end
1 Like

I dont quite understand what i do with this code, where do i put it and how can i use it?

What do i put in the “url” variable?

I assume by what you say, you wanna make the rigs wear your shirts. Just add them pants and shirts (Clothing) and put the Shirts ID in it.

Hello, try this:

local responseModule = require(game.ServerStorage.Modules.RetunResponse)

print(responseModule.getasync("https://groups.roblox.com/v1/groups/34734276"))

And this for getting avatar items:

local responseModule = require(game.ServerStorage.Modules.RetunResponse)

print(responseModule.getasync("https://catalog.roblox.com/v1/search/items?category=All&creatorTargetId=34734276&creatorType=Group&cursor=&limit=50&sortOrder=Desc&sortType=Updated"))
1 Like

Replace roblox.com with a proxy of your choice, for example roproxy.com

You can use the code by calling the function getGroupShirts with your group id and if you want, a limit of max results to be returned. This will return an array of shirt instances, that you can then parent into NPCs to load said shirts into the game.

He’s already using my proxy, the script i provided works

I want to get every single shirt from my group in my game, I do this so I don’t have to do the tedious time wasting task by hand

Yo what the hell, both things work fine. Im really amazed on this, why did my link thingy not work, but this did work? How does this all work.

Can you dm me? I want to know more

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.