Forum

> > CS2D > Scripts > Zombie Team Balance
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Zombie Team Balance

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Zombie Team Balance

Baloon
GAME BANNED Off Offline

Zitieren
Well, I make this thread to ask someone else who can fix this as well I imagine it.

If the zombie team is empty, one of survivors will be switched to zombie randomly.
1
2
3
4
5
6
7
8
9
10
addhook("second","checkzombie")
function checkzombie()
 for _,id in ipairs(player(0,"team2"))
  local zombies=player(0,"team1")
  if zombies<=0 then
   parse("maket "..id)
   break
  end
 end
end

It's not like I imagine well, it's not randomly. May someone give me the code?

alt Re: Zombie Team Balance

Talented Doge
User Off Offline

Zitieren
if not next(player(0, "team1"))

Check if team 1 is empty with this.

1
2
3
4
5
6
7
8
addhook("second","sss")

function sss()
	if not next(player(0, "team1")) and next(player(0, "team2")) then
		local a = math.random(1, #player(0, "team2"))
		msg(player(a, "name"))
	end
end

Set
math.randomseed
to os.time() if you are aware of it not being random enough. That will require a bit more work.
1× editiert, zuletzt 10.08.16 12:27:47
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht