Gamemode - Net Library - Callback error

Hello facepunch,

Over the past few weeks i’ve started to work on a little gamemode, it isn’t much at all, just something to help my skills out and improve.
I’ve somehow, come across a very big problem what I haven’t been able to solve for 2 days now. I’ve tried everything and i’m unable to succeed.

What I’m trying to do is when a player spawns, send him a panel, for some reason this is an issue. I’ve managed to find out that the panel wasn’t an issue but the only issue is when the message is being sent. The message doesn’t receive on the client and gives me the error below.


[ERROR] lua/includes/extensions/net.lua:32: attempt to call local 'func' (a string value)
  1. unknown - lua/includes/extensions/net.lua:32


// Server


function GM:PlayerSpawn(ply)



// Client

net.Receive("open_lobbyMenu", "GM_whenPlayerIsInLobby", function(length)
	print("Received from server.")


Hope you can help Facepunch, I’ve been trying very hard to do this, no success.
Help much appreciated.

The second argument for

net.Receive should be a function, not a string.

Oh my god! I would’ve never of spotted that. I know exactly why I’ve done that mistake, I’ve been doing alot on hooks!

Thank you ever so much! :smiley: