You don't need the "For p\prop.properties=Each properties" part:
;Create first player p.player=New player p\prop.properties=New properties p\prop\health=100 ;Create second player p.player=New player p\prop.properties=New properties p\prop\health=60 Print PlayerHealth(2) WaitKey() Type player Field prop.properties End Type Type properties Field health End Type Function PlayerHealth(player_number) For p.player=Each player count=count+1 If count=player_number Then ;For p\prop.properties=Each properties Return(p\prop\health) ;return health ;Next EndIf Next End Function