Forum

> > CS2D > Scripts > For Lua
Forums overviewCS2D overview Scripts overviewLog in to reply

English For Lua

10 replies
To the start Previous 1 Next To the start

old For Lua

1s1s
User Off Offline

Quote
When I download Lua how I put it in my server can u explain me how doing that?

old Re: For Lua

EP
User Off Offline

Quote
> 1st form:
1- Extract that lua in Counter Strike 2D/sys/lua/
2- Open Counter Strike 2D
3- Goto New Game
4- Goto More Setting
5- Find mp_luaserver
6- Change server.lua to THENAMEOFYOURLUA.lua
7- Click in Apply
8- Now you can start your server with dedicated or just click Start in that listen server

> 2nd form:
1- Goto Counter Strike 2D/sys/
2- Open "server.cfg"
3- Find mp_luaserver
4- Change "server.lua" to "nameofyourlua.lua"
5- Save
6- Close it
7- Done,

old Re: For Lua

oxytamine
User Off Offline

Quote
Add "dofile" attribute to "server.lua" file. user EP is wrong. It's retarded way.

old Re: For Lua

Starkkz
Moderator Off Offline

Quote
user oxytamine has written
Add "dofile" attribute to "server.lua" file. user EP is wrong. It's retarded way.


Why did you mean that?, that way is useful and faster than puting dofile in server.lua
Also that's why DC put that command.

old Re: For Lua

Flacko
User Off Offline

Quote
user Starkkz has written
user oxytamine has written
Add "dofile" attribute to "server.lua" file. user EP is wrong. It's retarded way.


Why did you mean that?, that way is useful

Actually, it's useless because you can only use one script at the same time. Dofile might be harder to use for newbies but it's the best way to do it.

old Re: For Lua

MikuAuahDark
User Off Offline

Quote
best way:
1. go to <YOUSCS2DPATH>(Most in C:\Counter-Strike 2D)\sys\lua
2. open server.lua with notepad
3. you will see some --dofile("sys/lua/blabla.lua")
4. put this at end of server.lua:
dofile("sys/lua/<YOULUANAME>.lua")
5. don't forgot to save...

there is a also sample script ready. just delete the -- before dofile

to disable script, just add -- before dofile

old Re: For Lua

Flacko
User Off Offline

Quote
protip: It works without parenthesis too.
1
dofile "sys/lua/name.lua"

old Re: For Lua

Apache uwu
User Off Offline

Quote
It doesn't work with variables

1
2
myfile="sys/lua/name.lua"
dofile myfile

old Re: For Lua

Flacko
User Off Offline

Quote
user Apache uwu has written
It doesn't work with variables

1
2
myfile="sys/lua/name.lua"
dofile myfile


No, but it works with tables too

old Re: For Lua

Starkkz
Moderator Off Offline

Quote
user Flacko has written
user Apache uwu has written
It doesn't work with variables

1
2
myfile="sys/lua/name.lua"
dofile myfile


No, but it works with tables too


does it support more than a parameter?

old Re: For Lua

Flacko
User Off Offline

Quote
I think not, otherwise the code would get confusing.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview