Accessing table information in a function.

So I have a for loop set up to get all players and it creates a table.



     for k, v in ipairs(player.GetAll()) do
           v.HealthTable = {};
           v.HealthTable.Body = 100;
           v.HealthTable.Mind = 100;
     end


So how would I use a function to access the HealthTable of a specific person?

if I try using,



     function GetPlayerHealth()
          print(ply.HealthTable.Head)
     end


Using a function structured like that, it says that the HealthTable is nil and can’t be accessed.

So how could I access this health table of specific players?

[lua]local plymeta = FindMetaTable(“Player”)
function plymeta:GetPlayerHealth()
return self.HealthTable.Head
end[/lua]
or
[lua]function _R.Player:GetPlayerHealth()
return self.HealthTable.Head
end[/lua]
or
[lua]function GetPlayerHealth(ply)
return ply.HealthTable.Head
end[/lua]

The first two would be called like this:
[lua]ply:GetPlayerHealth()[/lua]
And the last one like this:
[lua]GetPlayerHealth(ply)[/lua]