Forum

> > CS2D > Scripts > wait 10 seconds to enter a team
Forums overviewCS2D overview Scripts overviewLog in to reply

English wait 10 seconds to enter a team

2 replies
To the start Previous 1 Next To the start

old wait 10 seconds to enter a team

jerezinho
User Off Offline

Quote
Hi everyone.

Could someone help me with a small lua? that when a player enters the server must wait about 10 seconds to enter a team.

I know it must be easy but forget how it was done, a long time ago I do not work with lua

by the away, i searched and I did not find anything similar

thanks so much!

old Re: wait 10 seconds to enter a team

Rainoth
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
delay = {}
addhook("join","_join")
function _join(id)
	delay[id] = 10
end

addhook("second","_second")
function _second()
	for k,v in pairs (player(0,"table")) do
		if delay[v] > 0 then
			delay[v] = delay[v] - 1
		end
	end
end

addhook("team","_team")
function _team(id,team)
	if delay[id] > 0 then
		msg2(id,"Please wait "..delay[id].." second(s) before joining a team")
		return 1
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview