If I wrote 2 there, the loop would have just been done 5 times. Why do you want me to install one of them when I have Notepad? Marcell Marcell 1 1 silver badge 13 13 bronze badges. To make that possible I defined a number of events to which you can attach scripts by writing an event Lua scripts only run on server side in Counter-Strike 2D though. But at least, it tells you in which line you have to search for the error!

lua cs2d

Uploader: Shaktizragore
Date Added: 16 December 2007
File Size: 53.49 Mb
Operating Systems: Windows NT/2000/XP/2003/2003/7/8/10 MacOS 10/X
Downloads: 95703
Price: Free* [*Free Regsitration Required]

Most important thing is: If you equip a player an item with parse equip 1 64 then use comments with — if you’ve already forgotten to write which weapon is equiped.

Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Active 3 years ago.

Unreal Software – game dev and stuff

Using tabs to make your script clearly represented is very easy. Go to the last line of this file and add the following line there: Basilio German fs2d, 1 1 gold badge 11 11 silver badges 22 22 bronze badges. Sign up using Facebook. Two dots show cs2d that some strings are connected together. Let’s see the next line of our script. Then it’s really easy.


Counter Strike 2D: Critical Operations – Lua Scripters need for update Alpha 0.4! news

You could instead make the Lua administration script read the page. Marcell Marcell 1 1 silver badge 13 13 bronze badges. A while loop is simple.

Without all the comments it would have just looked like this: In the brackets, there are 2 different parts now. Writing ula a way easy to understand There are many people who want to show their scripts to others, or who want to understand their own scripts after some time without having to reread it ce2d times So, their are some possibilities to write in a way easy to understand.

Because they have a syntax highlighting option. Of course, you can nest if-queries: So you see, the debug message doesn’t really tell you what’s wrong.


What is a loop? There’s a key on your keyboard for that which should look like this: Let’s take a look at the same script WITH tabs: If this is the output, your script runs well, and errors can’t be found by cs2d.

lua cs2d

The example from before: Creating a scriptfile and using it in CS2D As most of you are asking how to use scripts which you got from others, or which you will make yourself soon, the first thing I want to tell you is how to use scripts. You can sandbox as much as you want, but if those functions are needed then you’re out of luck.


We can now do a little script, which sends every player on the server a message every minute: Now, every hook with “say” gives you two predefined variables.

lua cs2d

I’ll explain it later. This is First of all, xs2d will need to get a script editor for lua. Since this is a tutorial to get you started with Lua in Counter-Strike 2D, let’s jump right into action and make a script.

How to make cs2d lua scripts

Let’s see the next line of the script: Csd know only have to start CS2D and open a server with this map. A missing end is a good example for what can be a problem too: The first parameter is the id of the player in our case it’s saved in the variable playerthe second what you want to know about the player.

The interface to enter U.