Entity:EntIndex()

Is there a way to make Entity:EntIndex() work on a local code?

What exactly do you mean by that?