Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago
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?

0
whats the error the8bitdude11 358 — 4y
0
and which line is it the8bitdude11 358 — 4y
0
nevermind goodadmins 111 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Solved it, I replaced v with i.

Ad

Answer this question