send data between cl_init and init in a entity

maybe a noob question but. Can i somehow send data between cl_init and init in a entity?

You can, but the optimal way is gonna depend on type of data you’re sending and whether it’s client->server or server->client.

im trying to send a string from server to client

You could just use net.WriteString for that.

how do i do that?

i can’t use this when it’s not a player but a entity i want to send to


Why do you need to network a string to an entity?

i want to send a string to client side of entity on ENT:Touch

self:SetNW2String("SomeName", "YourStringHere")

You can. net.Send(ply) sends the network message to the client state, but not to a specific “file” of that state. If you have net.Receive(“mbtest”, function(len, ply) end) anywhere on the clientside, it will be run when you send the mbtest netmessage to the player.



Thanks just what i was looking for :goodjob: