English Zombie Gas Grenade

13 replies
Goto Page
To the start Previous 1 Next To the start
20.12.17 10:39:13 am
Up
CrazyPenguin
User
Offline Off
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
20.12.17 10:41:34 am
Up
apex2d
User
Offline Off
use Lua
Eat Sleep Conquer Repeat. www.Radeon2D.forumid.net
20.12.17 10:44:49 am
Up
CrazyPenguin
User
Offline Off
what lua code do I need to insert ?
AFTERLIFE >>24/7<< Online Dedicated Zombie Server ~ Connect IP: 94.177.171.167
20.12.17 02:12:39 pm
Up
apex2d
User
Offline Off
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
20.12.17 03:30:57 pm
Up
CrazyPenguin
User
Offline Off
Pick up
AFTERLIFE >>24/7<< Online Dedicated Zombie Server ~ Connect IP: 94.177.171.167
20.12.17 04:17:31 pm
Up
px20
GAME BANNED
Offline Off
Why would zombie pick gas grenade anyways? too overpowered
20.12.17 07:29:10 pm
Up
SkullFace
User
Offline Off
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.
IMG:https://i.imgur.com/kZBVkjM.gif
P.S. - I've been extracting recently enviromental sound files from other games, if anyone is interested in them for adding them to their maps, scripts, PM me
20.12.17 07:47:08 pm
Up
CrazyPenguin
User
Offline Off
user px20 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)
AFTERLIFE >>24/7<< Online Dedicated Zombie Server ~ Connect IP: 94.177.171.167
22.12.17 07:26:56 am
Up
Rainoth
Moderator
Offline Off
Code:
1
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
22.12.17 08:21:08 am
Up
CrazyPenguin
User
Offline Off
It does not seem to work....maybe its conflicting with this code I already run which gives everyone a wrench

Code:
1
2
3
4
addhook("spawn","_equipwrench")
function _equipwrench()
     return "74";
end


I also run server settings in this order

Code:
1
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

Code:
1
parse("removeitem "..iid)
AFTERLIFE >>24/7<< Online Dedicated Zombie Server ~ Connect IP: 94.177.171.167
22.12.17 05:20:32 pm
Up
Rainoth
Moderator
Offline Off
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
22.12.17 05:57:23 pm
Up
CrazyPenguin
User
Offline Off
but you did put space after function or am I not getting something ?

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
22.12.17 06:16:27 pm
Up
Rainoth
Moderator
Offline Off
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
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 √
23.12.17 04:44:07 am
Up
CrazyPenguin
User
Offline Off
@user Rainoth: thank you I can confirm it works now

you have been very helpful
AFTERLIFE >>24/7<< Online Dedicated Zombie Server ~ Connect IP: 94.177.171.167
To the start Previous 1 Next To the start