Forum
CS2D Scripts creating scriptcreating script
13 Antworten 1
Read this: http://cs2d.com/tut/tkdlua/luatut.html
Then download some easy scripts from the File Archive
You should know that if you haven't programmed yet, it will be hard to learn. Be patient
One year ago when I started to script in lua (CS2D scripts), I have been creating script like this:
1
2
3
4
2
3
4
addhook("minute","info") function info() 	msg("It's my own CS2D script!") end
or:
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("say","weapon") function iweapon(id,txt) 	if txt=="!help" then 		parse("equip "..id.." 69") 		parse("equip "..id.." 3") 		parse("equip "..id.." 41") 	end end
Now I make scripts like my [Bolt]Fun Zombie Mode (10) or Datei existiert nicht (10850).
2× editiert, zuletzt 10.04.12 14:20:32
1
2
3
4
2
3
4
addhook("minute","info") function info() msg("It's my own CS2D script!") end
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("say","weapon") function iweapon(id,txt) if txt=="!help" then parse("equip "..id.." 69") parse("equip "..id.." 3") parse("equip "..id.." 41") end end
If you ask what is it code:
CS2D execute code from lua scripts
1× editiert, zuletzt 10.04.12 22:02:03
WTF?
It also wouldn't hurt to read all the packaged lua function classes such as math, os, io, etc.
To really use lua, you need to understand how cs2d uses it as well with hooks. I'd say cs2d's addhook is similar to actionscript and javascripts "add listener".
Very funny.
1× editiert, zuletzt 11.04.12 21:26:45
Then save as *.lua
It's easiest way. You can also download lua editor, but I use notepad.
My Computer -> Tools -> View -> Hide Extensions For Known File Types -> Uncheck -> OK
Hangoooovver Says :
1
and do you know editor?
What are you talking about?
1