I’m not sure I understand Tables (even after reading the Tables documentation).
I have an array where if players are put there, they are safe and can continue to the next area.
for i, v in pairs(playerArray) do -- playerArray is the array in which contains the current alive players
if game.Players:FindFirstChild(v) then -- checks to see if those players are still in the game
if not table.find(safePlayersArray, v.Name) then
print("Someone died!");
game.Players:FindFirstChild(v).Character:BreakJoints();
end
end
end
For some reason, the players are dying regardless of being in that safePlayersArray or not.
FindFirstChild() uses a string, not an object, v in this case is an object, so you should use FindFirstChild(v.Name)
Actually scratch that, you can replace the whole thing with v
I’m assuming you are using players:Get players in order to get all the players. The issue is that you will get player objects and not the name of the players.
Table.find will not work here as it only searches for what is within the index and not what is within that object properties like a name, a for loop will be required instead.