Equip every 30 seconds
Forum
Scripts
Equip TRS SCRIPT
Equip 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 11:16:49 am
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
THEMUD your script will start grenades timer every time a player joins. So if many players joined, the equip would be called more than once per 30 seconds.@
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 08:49:08 pm
RIP-HereRestsPlookerbooy: You forgot do after the for loop.
VADemon: Thanks for mentioning. 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.
Dousea Oh,you are right. Thanks i edited the code again.
1

Offline