Forum
CS2D General Zombie Gas GrenadeZombie Gas Grenade
13 replies 1
Baloon has written
Why would zombie pick gas grenade anyways? too overpowered
not if I put a time limit on gas grenade spawn
it makes the game more interesting (also humans have a limited gas mask spawn)
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("walkover","_w") function _w(id,iid,type) if type == 72 then parse("equip "..id.." 72") parse("removeitem "..iid) end end
edited 2×, last 22.12.17 05:37:11 pm
1
2
3
4
2
3
4
addhook("spawn","_equipwrench") function _equipwrench() 	return "74"; end
I also run server settings in this order
1
2
3
2
3
mp_luaserver "SpawnWithWrenches.lua" mp_luaserver "zombieGas.lua" mp_luaserver "unlimitedbuild.lua"
the "zombieGas.lua" is the one with your code in it
also is "iid" a typo mistake for "id" or it has to be this way
1
parse("removeitem "..iid)
The reason its not working is because I didnt put space after the word 'function'.
id is player id
Iid is item id
Tye is item type (72 for gas grenade)
Also, your server settings should be dofile commands, not mp_luaserver
1
function _w(id,iid,type)
or do you mean space as in here
-> function
also what is a dofile command ?
Always check when the posts are edited.
dofile in server.lua to easily run multiple scripts.
What you do:
Put all scripts into 'sys/lua/' directory
Open up 'server.lua' and write
1
dofile("sys/lua/YourScriptName.lua")
Copy that line and run multiple lua script files like that.
Go to CS2D server settings, go to mp_luaserver, click default and click apply.
Done
you have been very helpful
1