Forum

> > CS2D > Scripts > Spawn Selected Zombie
Forums overviewCS2D overview Scripts overviewLog in to reply

English Spawn Selected Zombie

5 replies
To the start Previous 1 Next To the start

old Spawn Selected Zombie

samucaj
User Off Offline

Quote
Guys, I had an idea. I thought that a server you could choose the type of zombie that wanted. But it is not
choice according to ability (Tall, strong, fast) none of this is choosing the type of zombie. IMAGE zombie. For example, create more than one NPC. Ready! The question is this,
how do I make more NPC? I really wanted to create more than one zombie, and thank you!

1
2
3
4
1 - Start Game
2 - Select IMAGE zombie
3 - The zombie Is normal, but Image is different.
4 - Play, and have fun!

Sorry bad English, I'm not for here.

old Re: Spawn Selected Zombie

Apache uwu
User Off Offline

Quote
You can only place the image over the zombie, not replace.

I believe zombies are stored in objects(0,"table") with type '1'.

1
2
3
4
5
for _,npc in ipairs(object(0,"table")) do
	if object(npc,"type")=="1" then
		--place an image over object(npc,"x"),object(npc,"y")
	end
end

Then when the zombie dies remove the image.

old Re: Spawn Selected Zombie

Bowlinghead
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
-- Untestet, of curse
addhook("spawn","spawnlol")
function spawnlol(id)
	for _,npc in ipairs(object(0,"table")) do
   	  if object(npc,"type")=="1" then
       	   id=image("PATH!!!",1,1,200+id)
     	end
	end
end
addhook("die","dielol")
function dielol(v,k,w,x,y)
	freeimage(v)
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview