Forum

> > CS2D > Scripts > T & CT Boss script
Forums overviewCS2D overview Scripts overviewLog in to reply

English T & CT Boss script

9 replies
To the start Previous 1 Next To the start

old T & CT Boss script

RyceR
User Off Offline

Quote
Can any1 make script like that?
Random player in T is Boss - bosst[id]=1
Random player in CT is Boss - bossct[id]=1
Only it.

old Re: T & CT Boss script

DannyDeth
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function choose_bosses()
	local T_ids={}
	local CT_ids={}
	local boss_ids={}
	for i=1,32 do
		if player(i,"team")==1 then
			T_ids[i]
		else
			CT_ids[i]
		end
	end
	boss_ids[0]=T_ids[math.random(0,#T_ids)
	boss_ids[1]=CT_ids[math.random(0,#CT_ids)
	return boss_ids
end

This code returns an array which has 2 fields, [0] is the T boss and [1] is the CT boss. You could do this to give the bosses medic armour:

1
2
3
bosses = choose_bosses()
parse("equip "..bosses[0].." 82")
parse("equip "..bosses[1].." 82")

~DannyDeth

old Re: T & CT Boss script

Yasday
User Off Offline

Quote
1
2
3
4
5
6
function choose_bosses()
	local tbl = {}
	tbl[0] = player(0,"team1")[math.random(1,#player(1,"team1"))]
	tbl[1] = player(0,"team2")[math.random(1,#player(1,"team2"))]
	return tbl
end
Just like DannyDeth's code, but easier.
edited 3×, last 28.01.11 02:06:56 pm

old Re: T & CT Boss script

DannyDeth
User Off Offline

Quote
Uum? Easier? Yours is more efficient but not easier, I always write my script so they can easily be editted by newbies/people who are not familiar with Lua.

old Re: T & CT Boss script

RyceR
User Off Offline

Quote
@DannyDeth but how to write in your script any1 like CTboss[id]=1 and Tboss[id]=1?
I need it for "Array" function.
edited 1×, last 28.01.11 03:37:26 pm

old Re: T & CT Boss script

DannyDeth
User Off Offline

Quote
@Rycer:
Like this, maybe?
1
2
3
bosses = choose_bosses()
CTboss[bosses[1]]=1
Tboss[bosses[0]]=1

You know the function "initArray"? That is similar to my function, all it does is return an array, so bosses[0] is the terrorist boss id and bosses[1] is the ct bosses id.

old boss

thesk5tera
User Off Offline

Quote
plizz writhe the script i want zombie boss but one zombie in round and he have super armor and molotov cocktail and speed 5 plizz i need help
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview