sv_allowcslua admin only?

Is it possible to make sv_allowcslua admin only?
In that case, how?

I don’t know about directly but you could do something like easylua and run code from code that’s already on the server

Isn’t it only runnable through server console?

sv_allowcslua disables/enabled the possiblity to for example run the command below in the console yes.
So making like a command that runs a Lua script won’t be the solution.



lua_run_cl print(LocalPlayer():GetName())


Your best bet is to add your own lua_run_cl command that is admin only and uses RunString

something like

[lua]
concommand.Add( “_lua”, function( p, _, _, lua )

if not p:IsAdmin() then return end
RunString( lua )

end )[/lua]

[editline]24th May 2013[/editline]

You should be able to load files that way with something like _lua include( “yourfile.lua” )

Ahh! This works well.
Thanks :slight_smile: