T & CT Boss script
9 replies



28.01.11 10:20:31 am
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.
Random player in T is Boss - bosst[id]=1
Random player in CT is Boss - bossct[id]=1
Only it.

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
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:
Code:
1
2
3
2
3
bosses = choose_bosses()
parse("equip "..bosses[0].." 82")
parse("equip "..bosses[1].." 82")
parse("equip "..bosses[0].." 82")
parse("equip "..bosses[1].." 82")
~DannyDeth
Code:
1
2
3
4
5
6
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
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
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.
@DannyDeth but how to write in your script any1 like CTboss[id]=1 and Tboss[id]=1?
I need it for "Array" function.
I need it for "Array" function.
edited 1×, last 28.01.11 03:37:26 pm

@Rycer:
Like this, maybe?
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.
Like this, maybe?
Code:
1
2
3
2
3
bosses = choose_bosses()
CTboss[bosses[1]]=1
Tboss[bosses[0]]=1
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.
09.03.13 12:54:57 pm
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



