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

Trying to print a list of groups for everyone that joins the server?

2 comments

0

Put your code in code blocks within your questions. No need to provide any off-site links for it.

0

line 5 player.userId should be player.UserId -- capital U

1 answer

userId should be UserId

local Players = game:GetService("Players")
local groupsIn = {}
 
game.Players.PlayerAdded:connect(function(player)
local pages = game:GetService("GroupService"):GetGroupsAsync(player.UserId)
while true do
for _, group in pairs(pages:GetCurrentPages()) do
	table.insert(groupsIn, group)
end

if pages.IsFinished then
	break
end
pages:AdvanceToNextPageAsync()
end

print(groupsIn)

end)

Wiki Links:

Player/UserId

if you need any furture help please reply to this!

1 comment

0

same result

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