• send function variables through umsg
    2 replies, posted
So I know you can trigger functions with umsg but what if I want to trigger a function and send it specific variables like a certain entity or a vector?
Yeah, sending data is pretty much what usermessages are made for. [url]http://wiki.garrysmod.com/?title=User_Messages[/url]
For example... [lua] -- Serverside umsg.Start("PrintVectors") umsg.Vector( Vector(0,0,10) ) umsg.End() -- Clientside usermessage.Hook("PrintVectors",function(u) print( u:ReadVector() ) end)[/lua]
Sorry, you need to Log In to post a reply to this thread.