net.Receive can't see globals?

in my serverside code I have something like this



if SERVER then
	SomeTable = {}
	
	net.Receive("SomeString", function(len, ply)
		local tbl = net.ReadTable()

		if tbl then SomeTable = tbl end
	end)
end


and then when I use this, I get


attempt to index global 'SomeTable' (a nil value)

Whoops, well I fixed it. It was because it was inside of the if statement.

Post your actual code, not “something like” it. The code you gave wouldn’t give that error.

That wasn’t the issue, but I’ve fixed it.