Forum

> > CS2D > Scripts > random teror (lua)
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch random teror (lua)

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt random teror (lua)

limonata
User Off Offline

Zitieren
Hello, i tried to make this script but it doesnt work. Where is my mistake?

Every round random terörist will be CT.

Here is my script:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
m = 0

local random_ct = player(0,'team1')
addhook("startround","asd")
function asd(id)
	for _, i in ipairs(#random_ct) do
		local a = math.random(i)
		m = 1
		parse("makect "..a)
	end
end
	
	
addhook("team","a")
function a(id,team)
	if team == 2 and m ~= 1 then
		return 1
	else
		return 0
	end
end

May someone help me ?
2× editiert, zuletzt 15.06.13 19:56:36

alt Re: random teror (lua)

MikuAuahDark
User Off Offline

Zitieren
Code to fix startround function:
1
2
3
4
5
function asd()
	if #player(0,"team1")>0 then
		parse("makect "..player(0,"team1")[math.random(1,#player(0,"team1"))])
	end
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht