Forum
CS2D Scripts How to start programming in Lua?How to start programming in Lua?
19 replies 1
Bobb1118 has written
I'd like to know, which file would change the main files in CS2D? Specifically, I'd like to change gun names, damages, fire rates, add experience and leveling, and gametype options.
You can't change gun names. Only with hex. It's illegal.
You can change damage in the console.
You can't change fire rate.
Exp and leveling - look for tibia.
Gametype options - most of it can be changed through server cp.
Bobb1118 has written
ughhh -.- can I add new guns? Is there a way to save the gun damages when they are changed?
New guns - Impossible
Saving those settings for weapon damage - Use your autoexec.cfg that is in your sys folder (Only affects your own server)
Bobb1118 has written
ughhh -.- can I add new guns? Is there a way to save the gun damages when they are changed?
No.
EDIT: what Pikachu said.
But you CANT make your own (shooting) weapons in CS2D!
You only can make your own guns like this:
Gasmask script | NEW ITEM! | by Todesengel (20)
www.cs2d.com/help.php?cat=all
or also this maybe
www.cs2d.com/help.php?cat=controls
i only have internet here and its a blocked website.. :c
Wait...
btw in the info.txt at your Counter-Strike 2D/sys/lua folder is helping you!
alright so i made a little script. how in the autoexec.cfg file do i activate it?
edited 1×, last 12.10.11 05:15:01 pm
Lua scripts go in sys/lua/server.lua
CS2D commands with aliases and binds go in sys/autoexec.cfg
read sys/lua/info.txt, sys/lua/server.lua and the samples in sys/lua/samples if you want to write Lua scripts.
I'm trying to make a basic leveling system. 100 xp for a kill, 500 xp per level, max 80 levels.
right now i get the error :48: '<eof>' expected near 'end'
halp?
also want to have a bar that stays on screen all the time that shows experience, and shows your level. also a "+100 exp" popup over you when you kill someone and a "Level up! Level increased to (current level)"
1
2
3
2
3
if your_level[id]>80 then -- If this level is higher then 80 	your_level[id]=80 -- Then reset the level to 80! end
<eof> means "end of function" (or something like that) . You forgot an end or made to much ends.
If you use notepad++ you see if you forgot an end or you made 1 end to much.
BUT IN YOUR SCRIPT IS 1 END TO MUCH!
1
2
3
4
5
2
3
4
5
if (sample.gg.experience[id]>=500) then -- Increase Level sample.gg.level[id]=sample.gg.level[id]+1 end -- This end is wrong end
EVERY "if then" "function" "for do" and other need an END!
how do i use hudtext?
BUT for level scripts you need to make hudtxt2!
hudtxt: Shows hudtext to all.
hudtxt 2: Shows hudtext to only 1.
(Click for zoom)
Read tutorial at wiki.
edited 1×, last 12.10.11 07:40:52 pm
Bobb1118 has written
I'd like to know, which file would change the main files in CS2D? Specifically, I'd like to change gun names, damages, fire rates, add experience and leveling, and gametype options.
1. open notepad
2. start typing
3. ???
4. PROFIT!
----
First thing: quit your friends.
Second thing: learn Lua
1