Equip every 30 seconds
Forum
CS2D Scripts Equip TRS SCRIPTEquip TRS SCRIPT
7 replies 1
Equip every 30 seconds
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
equiptimer = 0 addhook("second","equiphe") function equiphe() 	if equiptimer == 30 then 		equiptimer = 0 		for _, id in ipairs(player(0, "team1living")) do 			parse("equip "..id.." 51") 		end 	else 		equiptimer = equiptimer + 1 	end end
Edited
VADemon Thanks for your tip,I appreciate it so much :).
edited 2×, last 01.02.16 12:16:49 pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function Grenades() 	for _, id in ipairs(player(0, "team1living")) 		do 		parse("equip "..id.." 51"); 	end 	delay = false; end addhook("join", "_join") function _join(id) 	timer(30000, "Grenades"); 	delay = true; end addhook("ms100", "_ms100") function _ms100() 	if delay ~= true then 		timer(30000, "Grenades"); 		delay = true; 	end end
@ RIP-HereRestsPlookerbooy: your script is straightforward and works flawlessly. Tip: you should use for _, id in ipairs(player(0, "team1living")) to iterate through players.
UPD: Screw that ^ it is a poor advice
edited 1×, last 01.02.16 09:49:08 pm
Otherwise, my code seems unusable. Because I tried to modfy it, and I came with storing a variable for every player who joins.
And it works, but it just gives that specified player the grenade not all the terrorists which is not the right intended of this code.
Thus, better use @ RIP-HereRestsPlookerbooy's code.
1