The second parameter of OnTakeDamage is a TakeDamageInfo struct. This struct contains an Attacker value. The value is of a cEntity object, but you can cast it to a cPlayer if you are sure it is a player.
If you're just wondering about the casting, use this:
Be sure you are actually dealing with a cPlayer object by checking it with TDI.Attacker:IsPlayer() or TDI.Attacker:IsA("cPlayer"). The former is faster than the latter but both work.
If you're just wondering about the casting, use this:
local AttackerPlayer = tolua.cast(TDI.Attacker,"cPlayer")
Be sure you are actually dealing with a cPlayer object by checking it with TDI.Attacker:IsPlayer() or TDI.Attacker:IsA("cPlayer"). The former is faster than the latter but both work.