You can write your topic however you want, but you need to answer these questions:
-
I want it to grab all the players in the CurrentPlayers array
-
When I’m looping it, it only gets the first index of the array even tho when printing the array it shows 2 indexes
– THE CODE
for plrInd, plrInst in pairs(PartySession[IndFromName].CurrentPlayers) do -- for loop that runs thru th etable
print("Processing player:", plrInst) -- prints all the player
print(PartySession[IndFromName].CurrentPlayers)
local plrChar = plrInst.Character
OnPlrRemoving(plrInst)
RepStorage.removeCamClient:FireClient(plrInst)
updateImageOfPeople(IndFromName)
if plrChar then
onPartyManage:FireClient(plrInst, false)
plrChar:MoveTo(ExitPad.Position)
if plrInst.PlayerGui then
plrInst.PlayerGui.MenuH.Enabled = true
else
print("PlayerGui not found for player:", plrInst)
end
else
print("Character not found for player:", plrInst)
end
PartySession[IndFromName].DoorsOpen = doDoors(PartySession[IndFromName].Model, true)
end
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.