Zombie Gas Grenade
13 replies



20.12.17 10:39:13 am
How do some zombies have gas grenades in zombie mode on bunker map ? Since they can't pick one up
AFTERLIFE >>24/7<< Online Dedicated Zombie Server ~ Connect IP: 94.177.171.167
what lua code do I need to insert ?
AFTERLIFE >>24/7<< Online Dedicated Zombie Server ~ Connect IP: 94.177.171.167
You want the Zombies to spawn with Gas Grenade or You want Zombies to pickup Gas Grenades
Eat Sleep Conquer Repeat. www.Radeon2D.forumid.net
Well, if you've put like a random math on spawn hook, that way, only sometimes zombies would get a gas grenade on spawn and could help zombies to steer away survivors from ''bunkering'' so much. I actually like that idea.


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)
AFTERLIFE >>24/7<< Online Dedicated Zombie Server ~ Connect IP: 94.177.171.167
Code:
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
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
It does not seem to work....maybe its conflicting with this code I already run which gives everyone a wrench
I also run server settings in this order
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
Code:
1
2
3
4
2
3
4
addhook("spawn","_equipwrench")
function _equipwrench()
return "74";
end
function _equipwrench()
return "74";
end
I also run server settings in this order
Code:
1
2
3
2
3
mp_luaserver "SpawnWithWrenches.lua"
mp_luaserver "zombieGas.lua"
mp_luaserver "unlimitedbuild.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
Code:
1
parse("removeitem "..iid)
AFTERLIFE >>24/7<< Online Dedicated Zombie Server ~ Connect IP: 94.177.171.167
I wrote it via phone so its hard to go in depth.
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
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
but you did put space after function or am I not getting something ?
or do you mean space as in here
also what is a dofile command ?
Code:
1
function _w(id,iid,type)
or do you mean space as in here
-> function
also what is a dofile command ?
AFTERLIFE >>24/7<< Online Dedicated Zombie Server ~ Connect IP: 94.177.171.167
I fixed it in the code I posted, that's why you look at it now and see that everything's good.
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
Where 'YourScriptName' is the name of your lua script file.
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
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
Code:
1
dofile("sys/lua/YourScriptName.lua")
Where 'YourScriptName' is the name of your lua script file.
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




