Forum

> > CS2D > Scripts > Need round script.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Need round script.

19 replies
To the start Previous 1 Next To the start

old Need round script.

Jaso
BANNED Off Offline

Quote
I need a script like this:
Message pops up ROUND 1 in red letters.
Npc zombies spawn on a location.
When you killed all npcs it will say in a few min ROUND 2 now it goes the same so just in a kind of loop but every round there will be more and more npcs so could some one make this.
Is there even a way to check with script if there is no npc left?
I hope some one (WILL) take time for this and not some guy who says go do it by yourself or its to HARD.

old Re: Need round script.

DannyDeth
User Off Offline

Quote
1
2
3
4
5
6
round_count = 0
addhook("startround","start_msg")
function start_msg(){
	round_count = round_count + 1
	msg("©255000000ROUND "..round_count.."!@C")
end
I dobelive this will do what you want to do.

old Re: Need round script.

Jaso
BANNED Off Offline

Quote
Nono you are missing some parts like the npc spawning and the script that is checking if there are any npcs left so if there are no npcs left the next round starts and does the same so npcs will spawn in round 2 this time there are more of them so if you kill them all again round 3 start *IF YOU KILL ALL NPCS*

old Re: Need round script.

DannyDeth
User Off Offline

Quote
What the fuck are you saying? You ave not got a single punctuation mark, thereby rendering your failure of the English language completely unreadable.

old Re: Need round script.

Jaso
BANNED Off Offline

Quote
wtf your english must be really bad than what you dont understand about NPCS and the words checking, lua, and rounds i think youre english is even worser than mine.

old Re: Need round script.

DannyDeth
User Off Offline

Quote
jaso55 has written
youre english is even worser than mine.

Think about what you just said.

You're = You are, this should be 'your'
worser = this is just one big fail, you have taken a word that describes how osmething is more than bad, and made it double over on itself, thereby marking it completely incorrect, this is the kind of mistake 6-year-olds make.

So no, I have better English.

And now for the code you want:
1. How do I know how many NPCs there are?
2. Are these NPCs scripted in Lua or zombie-type NPCs?
3. Is there an array or varible that contains the number of zombies?
4. What are the coordinates that the NPCs are supposed to spawn at?
etc, etc

You aren;t going to get a valid answer form anyone until you fill in ALL of the details needed.

old Re: Need round script.

Jaso
BANNED Off Offline

Quote
If you just had readed what i wrote you would understand me.

The NPCS have to be just in the lua.
Its a wave system so every wave/round there will be MORE of them.

A new round starts after you killed ALL npcs.

And it doesnt matter at this point were the npcs spawn i will change that later just make an beginning like just a random position.

And there are no variables


And about the kid thingy you are really wrong if i was a kid from 6 years old than i couldnt even write this shit.
And i am learning english at school.
edited 1×, last 09.02.11 03:43:03 pm

old Re: Need round script.

DannyDeth
User Off Offline

Quote
And are the NPCs ones that you place on the map or the ones that happen when you join Terrorists ( zombies )?

old Re: Need round script.

Danikah
User Off Offline

Quote
I cannot believe that you didn't understand it first.
He need a script, which:
1. Writes "Round X" where X is a predefined number.
2. The script must spawn NPC Zombies on the map on random locations. The number of Zombies is based on the Round number, for example:
- Round 1: Less zombie NPCs.
- Round 31: Lotsa zombie NPCs.
3. When there are no more NPC Zombie left, the number "X" must be increased by one. Then do all of this again.

old Re: Need round script.

EngiN33R
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
round = 1
npcs = 2

addhook("startround","round1")
function round1()
	msg("©255000000Round "..round)
	npcs=(round*3)-round
	local xr=math.random(0,map("xsize"))
	local yr=math.random(0,map("ysize"))
	for i=1,npcs do
		parse("spawnnpc 1 "..xr.." "..yr.." 0")
	end
end

addhook("objectkill","npckill")
function npckill(obj,id)
	if (object(obj,"type")==30) then
		if (npcs>1) then
			npcs=npcs-1
		else
			npcs=0
			timer(30000,"parse","lua changeround()")
		end
	end
end

function changeround()
	local xr=1,map("xsize")
	local yr=1,map("ysize")
	round=round+1
	msg("©255000000Round "..round)
	npcs=(round*3)-round
	for n=1,npcs do
		parse("spawnnpc 1 "..xr.." "..yr.." 0")
	end
end
Tell me if there are any bugs.

old Re: Need round script.

Jaso
BANNED Off Offline

Quote
@EngiN33R
Hmm its says an error about some wrong tiles could you please change the random position to a normal postion like Y5-X8
edited 1×, last 10.02.11 03:31:01 pm

old Re: Need round script.

EngiN33R
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
round = 1
npcs = 2

addhook("startround","round1")
function round1()
     msg("©255000000Round "..round)
     npcs=(round*3)-round
     local xr=math.random(0,map("xsize"))
     local yr=math.random(0,map("ysize"))
     for i=1,npcs do
          if (tile(xr,yr,"property")~=1 and tile(xr,yr,"property")~=1 and tile(xr,yr,"property")~=2 and tile(xr,yr,"property")~=3 and tile(xr,yr,"property")~=4 and tile(xr,yr,"property")~=50 and tile(xr,yr,"property")~=51 and tile(xr,yr,"property")~=52 and tile(xr,yr,"property")~=53) then
          	parse("spawnnpc 1 "..xr.." "..yr.." 0")
	else
		parse("spawnnpc 1 "..xr.." "..yr.." 0")
	end
     end
end

addhook("objectkill","npckill")
function npckill(obj,id)
     if (object(obj,"type")==30) then
          if (npcs>1) then
               npcs=npcs-1
          else
               npcs=0
               timer(30000,"parse","lua changeround()")
          end
     end
end

function changeround()
     local xr=1,map("xsize")
     local yr=1,map("ysize")
     round=round+1
     msg("©255000000Round "..round)
     npcs=(round*3)-round
     for n=1,npcs do
	if (tile(xr,yr,"property")~=1 and tile(xr,yr,"property")~=1 and tile(xr,yr,"property")~=2 and tile(xr,yr,"property")~=3 and tile(xr,yr,"property")~=4 and tile(xr,yr,"property")~=50 and tile(xr,yr,"property")~=51 and tile(xr,yr,"property")~=52 and tile(xr,yr,"property")~=53) then
          parse("spawnnpc 1 "..xr.." "..yr.." 0")
	else
	  local xr=1,map("xsize")
     	  local yr=1,map("ysize")
          	parse("spawnnpc 1 "..xr.." "..yr.." 0")
	end
     end
end

Try this. It's funny, but your script is actually a bit hard to do.

old Re: Need round script.

Jaso
BANNED Off Offline

Quote
Ok there are a few thing that need to be fixed the zombies are put together when they spawn and if you die and spawn again the round number is still 3 it has to be 1 again.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview