Net Messages Problem/Indexing

Herro, looked all over google and couldn’t find anything.

Basically what I am trying to get my script to do is when a client calls the menu, the client will send a message to the server which will then respond with an ent object.
The client script then gets the ent object and sets it to a var.

So I know the ent var gets set because I do a check to see if my server sends the ent back, if the client gets that ent and what ent it is.

This is my error:

This is what prints in chat:

This is my client code:

This is my server code:

Been trying to figure this out for a bit.

The reason is that your code outside of callback starts executing way before you even sent the message, and so your ent variable will hold nil as the default value.

Alright, thanks