Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 2161 162 163338 339 Next To the start

old Script on start.

Flametail
User Off Offline

Quote
How can I make a whole lotta scripts execute upon starting a map?


AKA: when a map is started, turret health is set higher, and price lower, etc etc. I hate having to type all those scripts in the console whenever I start a game

old Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Quote
Flametail has written
How can I make a whole lotta scripts execute upon starting a map?


AKA: when a map is started, turret health is set higher, and price lower, etc etc. I hate having to type all those scripts in the console whenever I start a game


you want a script to set your turret health and price when you start your server .

if that here is a little script to make all that you must put it on Counter-Strike 2D/sys/lua/server remember to rename this script to Server.lua,before starting any servers . here the script to make all that :-
Spoiler >


here if you need more command check Cs2d.com

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
memo has written
you want a script to set your turret health and price when you start your server .

if that here is a little script to make all that you must put it on Counter-Strike 2D/sys/lua/server remember to rename this script to Server.lua,before starting any servers . here the script to make all that :-

I think he means making a script which only runs when you start a specified map.

old Re: Lua Scripts/Questions/Help

Flametail
User Off Offline

Quote
yeah, specific map only please.


and is there a command i can use to equip all players with certain weapons? instead of one at a time?

instead of equip 1 88
equip whatever you put for all players 88

I noticed that 0 doesnt work in this case

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Flametail has written
and is there a command i can use to equip all players with certain weapons? instead of one at a time?

instead of equip 1 88
equip whatever you put for all players 88

I noticed that 0 doesnt work in this case

Yes there is...
1
2
3
4
addhook("spawn","getallweapons")
function getallweapons(id)
parse("equip "..id.." 88")
end

old Re: Lua Scripts/Questions/Help

Anders4000
User Off Offline

Quote
@Flametail

If you want to make a script for a specific map you have to save the lua-script in the "maps" folder. You'll also have to save is as the mapname and then with ".lua" in the end.
Fx. if i want to make a lua-script for de_dust i'll save the script in the "maps" folder called "de_dust.lua"

When you click "New game" in the cs2d menu you will also have to go into "More settings" and set "mp_luamap" to 1. Else it will not work i think (:

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
The only problem I see in making a lua file called as the map is that it will be sent to the visitors, and if you use a common map like de_dust your folder will be spammed with scripts

You can use a startround hook and use game("sv_map")

old Re: Lua Scripts/Questions/Help

0ito
User Off Offline

Quote
need help for put the terrorists and counter-terrorist in the survivors in the zombie mod if someone help me on what to put in the script I thank

old Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Quote
0ito has written
need help for put the terrorists and counter-terrorist in the survivors in the zombie mod if someone help me on what to put in the script I thank


Yea that's good question i need to know if it possible to make Survivor team have both of Tt & Ct players,and if it possible to make a new Zombies skin and put them on the Zombies Team ?

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
If you only need to know if that's possible...
Yes, that's possible. (About skins)
edited 1×, last 12.02.10 01:00:48 am

old Re: Lua Scripts/Questions/Help

Flametail
User Off Offline

Quote
redefinder has written
Flametail has written
and is there a command i can use to equip all players with certain weapons? instead of one at a time?

instead of equip 1 88
equip whatever you put for all players 88

I noticed that 0 doesnt work in this case

Yes there is...
1
2
3
4
addhook("spawn","getallweapons")
function getallweapons(id)
parse("equip "..id.." 88")
end


same idea for a global speedmod or setmaxhealth?

old Ammo

Maniek
User Off Offline

Quote
Hi

I need script for ammo like this.
When I attack with matchet on player position will be spawn primarammo and secondary ammo .
Can somoeone help me ???

Sorry for my bad English I'm from Polish.

old Re: Lua Scripts/Questions/Help

- Dark Void -
User Off Offline

Quote
another question i am a little confused
1
2
3
if not (variable) then
...
end
would continue if variable is not a false value. correct?
and
1
2
3
if (variable) then
...
end
would continue if variable is true. correct?

old Re: Lua Scripts/Questions/Help

TimeQuesT
User Off Offline

Quote
what do you want i'm not understanding you right.
do you mean a boolean?

if x == true then
xyz
end

if x == false then / if x ~=true(the same)
xyz
end

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Flametail has written
same idea for a global speedmod or setmaxhealth?

Just change commands.
For speedmod:
1
parse("speedmod "..id.." 10)
For health:
1
parse("setmaxhealth "..id.." 250)

old Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

Quote
Kking has written
Can someone help me i wana make a script (for admins) but i dont have lua knowledge plz reply

What exactly do you want?
To the start Previous 1 2161 162 163338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview