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:




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



Code:



// Server

util.AddNetworkString("open_lobbyMenu")

function GM:PlayerSpawn(ply)

	net.Start("open_lobbyMenu")
	net.Send(ply)  

end


// Client

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

end)



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: