CONTEXT: I’m making a party system (shown in the picture attached), and each time a new player joins the party, the blanks should update with the list of members and the party leader (already have the backend of the party set up and all that). Just one thing I’m puzzled on is a way to not change all the "N/A"s at once if I where to loop them
Since doing if x.Text == “N/A” would change all of them, instead of just one. I was wondering (for scripting this) if there was a way to see if there’s already contents in a textbox (which would be a party members name) and skip over it to fill the name into the next open text box
Here’s the function
local function displayInParty()
local PlayerParty = Parties:FindFirstChild(game.Players.LocalPlayer.Name .. "_party")
local PlayerMembers = PlayerParty:FindFirstChild("Members")
local leader = nil
local members = {}
for i, v in ipairs(PlayerMembers:GetChildren()) do
if v:FindFirstChild("Leader") then
leader = v.Name
else
table.insert(members, v.Name)
end
end
table.sort(members, function(a, b)
return a < b
end)
Party.PartyFrame.Leader.Text = tostring(leader); Party.PartyFrame.Leader.TextColor3 = Color3.new(0.505882, 0.917647, 1)
for x, member in pairs(Party.PartyFrame:GetChildren()) do
if member:IsA("TextLabel") and member.Name ~= "Leader" then
-- (I'm trying to figure out what I would do in here)
end
end
end
This is how it’s setup/formatted in studio
TLDR/Continuation: If there’s available space in the next (singular, only one) text box, it will fill that box
with a name and leave the other ones open