gm_luanet - .NET 3.5 for Lua

This is basically a small port I made of LuaInterface.

Basically what LI does, in terms of scripting, allows .NET compliant code to be directly executed in Lua and of which treats Lua as another .NET language (Lua functions can be hooked to functions like Click on a form.)

This is completely open to the .NET interface so any native and non native namespaces may be loaded…

require ‘luanet’

luanet.load_assembly(‘mscorlib’) --load_assembly loads a .NET library; the argument may be a dll too
Thread = luanet.import_type(‘System.Threading.Thread’) --Reference an object or namespace

local somevalue

local th = Thread(function ()
print ‘hai’
somevalue = 1 + 1

require ‘luanet’


frm = Form()


For a guide on native namespaces in 3.5:
For a small usage tutorial:

To install: Place the “LuaInterface.dll” file in your root directory where your “hl2.exe” is placed; put “gm_luanet.dll” in “garrysmod/lua/includes/modules”

Before posting about any problems running this: please be sure you have the .NET framework 3.5 and the visual c++ 2008 runtimes installed.


There are no security filters on this module yet, think about this before deploying. To add a custom .net library drop it into the same place as “LuaInterface.dll”

Cool, I can imagine this being useful on servers in many ways.


I don’t think that is the best example, though. A single Lua state is not thread safe.

True, I need to add options for a lua state lock or to create a new thread off of the stack.

Will this make my lua make c++heeseburgers too? :3