How to get NetworkPlayer?

Hello I want to use RPC with NetworkPlayer.

But how to get the NetworkPlayer ID?

var test : NetworkPlayer = NetworkPlayer; Return back "Cannot convert 'System.Type' to 'UnityEngine.NetworkPlayer'."

Please help, thanks.

Easiest way is to implement the OnPlayerConnected(NetworkPlayer player) function. Just like Update(). You can also get the Networkview Component and look up its "owner" member. This contains the NetworkPlayer associated with this NetworkView.

Network.player