[:en]Hello and welcome. If you’re a beginner in the world of Counter-Strike 2D Lua, then stay a while and listen. If you consider yourself above beginner, stay anyway – for fun, you know?
This page is not a beginner’s tutorial on Lua. If that’s what you’re looking for, you should visit this page.
What is CS2D Lua?
It’s an implementation of Lua, a lightweight, extensible programming language designed to be embedded in various programs and applications. There’s nothing truly unique about this particular implementation, it is simply built with functions not present in pure Lua, which are specific to the game.
How do I use CS2D Lua?
There are a couple of ways. You could set
mp_luaserver in server settings to a file, and that Lua file (in the
sys/lua folder) will get executed when your server starts. Alternatively, you could put files into the
sys/lua/autorun folder, and they will get executed automatically. Finally, you could enable
mp_luamap in server settings and make a script for a map in the
maps folder, making its name exactly the same as the map’s – it will get executed whenever the server switches to that map.
How do I write in CS2D Lua?
To write in CS2D Lua, you should first be able to write in pure Lua. The tutorial introduces you to the basics of both and should get you started. Once you’re past the simple things, you’ll need to regularly check the Lua reference manual and the CS2D help for details on the functionality and usage of different functions and hooks.[:]