#ok so, how do i fix this code
32 messages · Page 1 of 1 (latest)
There seems to be an unnecessary } after "ExceptionRank"
no it's not full
Also replace ; with , after each item in the first table
return {
{
GroupName = "Training Command",
BackGroundColor = Color3.new(0.839216, 0.0509804, 0.0509804),
DivTag = "Training Command";
Icon = "12792463010",
GroupID = {32043390};
ExceptionRank = {4};
},
{
GroupName = "SF - Land Forces",
BackGroundColor = Color3.new(0.129412, 0.129412, 0.129412),
DivTag = "SF - Land Forces";
Icon = "13238974464",
GroupID = {32050657};
ExceptionRank = {5};
},
{
GroupName = "SF - Awaiting Ranking",
BackGroundColor = Color3.new(0.129412, 0.129412, 0.129412),
DivTag = "SF - Awaiting Ranking";
Icon = "12792463010",
GroupID = {32043356};
ExceptionRank = {1};
},
{
GroupName = "Army Staff",
BackGroundColor = Color3.new(1, 0.0588235, 0.0588235),
DivTag = "Army Staff";
Icon = "13239041858",
GroupID = {16124932};
ExceptionRank = {254};
},
}
local function getGroupInformation(groupId)
local group = game:GetService("GroupService"):GetGroupInfoAsync(groupId)
for i,v in group.Roles do
print(v.Name, v.Rank)
end
end
getGroupInformation(7076400)
Bro thats optional
what
I think your code returns before it gets to that part.
so what do i do
** You are now Level 1! **
Put the return at the end
Move this to be above
local function getGroupInformation(groupId) local group = game:GetService("GroupService"):GetGroupInfoAsync(groupId) for i,v in group.Roles do print(v.Name, v.Rank) end end getGroupInformation(7076400)
Above the return
👍
** You are now Level 1! **
groupId is in brackets
this doesnt effect the table at al l
** You are now Level 3! **
that or do
GroupTable.GroupID[1] when your putting it into the getGroupInformation function
(but why would you do that)
local function Instance_Group(...)
local Args = {...}
local Object = {
GroupName;
BackgroundColor3;
DivisionTag;
Icon;
GroupID;
ExceptionRank;
};
Object = setmetatable(Args,getmetatable(Object));
return Object;
end
Group_Manager = {};
Group_Manager.Army_Staff = Instance_Group({
"Army Staff",
Color3.new(1,0.0588,0.0588),
"Army Staff",
13239041858, -- needs to be an Integer type not a String type
16124932,
254
});
print(Group_Manager.Army_Staff);
local function GetGroupInfo(groupId)
local GroupAsync = game:GetService("GroupService"):GetGroupInfoAsync(groupId);
for _,Role in pairs(GroupAsync.Roles) do
print(Role.Name,Role.Rank);
end
end
GetGroupInfo(Group_Manager.Army_Staff.GroupID);