Umsg reading string in target entity variable not working?

Sorry for the inaccurate title. I have an entity which uses user messages. The server side code sends a user message like so to the client code:



	umsg.Start("stage1")
		umsg.Entity(self)
		umsg.String("hallooo")
	umsg.End()


What I want to do is set a pre defined variable in cl_init to the value of the string in the usermessage. I declare the string like so:


ENT.desc = "this is my entities string"

and then in the user message receiving bit I do this:



usermessage.Hook("stage1", function(entity, string1) 
		local targ = entity:ReadEntity()
		targ.desc = string1:ReadString()
	end)


However, that just returns:



[ERROR] cl_init.lua:52: attempt to index local 'string1' (a nil value)
  1. Function - cl_init.lua:52
   2. unknown - lua/includes/modules/usermessage.lua:87


I know I should probably be using the network library but is it really that crucial? Will it help me out in this situation?
Thanks!

that’s not how it works, usermessage uses a “bf_read” thing that you need to specify:

[lua]
usermessage.Hook(“stage1”, function(data)
local targ = data:ReadEntity()
targ.desc = data:ReadString()
end)
[/lua]

Usermessages are queued and are just a wrapper for net messages. So yeah, use net messages they’re not hard.

Source?

JetBoom.