Forum

> > CS2D > Maps/Editor > Make lua in map?
Forums overviewCS2D overview Maps/Editor overviewLog in to reply

English Make lua in map?

12 replies
To the start Previous 1 Next To the start

old Make lua in map?

Crazy_Biawak
User Off Offline

Quote
Hi there!
I know make lua in map like this
Example:
1
2
3
4
5
6
7
addhook('spawn', 'inspawn')
function inspawn(id)
     parse('setmaxhealth '.. id ..' 1')
     parse("equip "..id.." 35")
     parse("setarmor "..id.." 100")
     parse("setweapon "..id.." 35")
end
But i want more to know?
edited 3×, last 17.09.11 01:31:41 pm

old Re: Make lua in map?

Tajifun
User Off Offline

Quote
Do you mean a lua script, which will be executed automatically, if you play a certain map?

old Re: Make lua in map?

Yates
Reviewer Off Offline

Quote
Then if you were to start a server. The lua would be sent with the map. Which isn't handy, is it?

old Re: Make lua in map?

Apache uwu
User Off Offline

Quote
@Yates, that would be useful if you wanted your map to work for anyone who runs it on their own.

old Re: Make lua in map?

danh
User Off Offline

Quote
if u hav a map named testThingy.map, u need a lua called testThingy.lua. Basically, u need to name the lua the same as the map (and .lua at the end), and put it in /maps

old Re: Make lua in map?

Yates
Reviewer Off Offline

Quote
user danh has written
[...] and put it in /maps

You don't need to put the Lua in the map folder. As long as it has the same name as the map it will be transfered with the map.
To the start Previous 1 Next To the start
Log in to reply Maps/Editor overviewCS2D overviewForums overview