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

[SOLVED] How do I iterate a table inside a table while also iterating through the first one?

local GROUPS_WITH_COLOR = {
	["1"] = { 
		["255"] = Color.Red
	};
}

I'm trying to make it so that it iterates through GROUPS_WITH_COLOR , then iterate through all tables inside that table. And check if the player is that rank in that group. If so, give them the color red. This was my attempt at this:


for i, v in pairs(GROUPS_WITH_COLOR) do
	print(v.v)
	local player = game.Players.LocalPlayer
	local Chat = player.PlayerGui.Chat.Frame.ChatChannelParentFrame.Frame_MessageLogDisplay.Scroller.ChildAdded:Connect(function(Frame)
		print(player:GetRankInGroup(2))
		if player:GetRankInGroup(v) then
			
		end
	end)
end

However, it errors. Anyone know how to fix this?

3 comments

0

whats the error

0

and which line is it

0

nevermind

1 answer

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