Forum

> > CS2D > Scripts > Hurt every 2 seconds?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Hurt every 2 seconds?

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Hurt every 2 seconds?

Dovahkin
User Off Offline

Zitieren
I've been wondering on how do you make the second hook to actually make it 2 seconds?

For example :
1
2
3
4
5
6
7
8
addhook("second","decay")
function decay()
	for id=1,32 do
		if player(id,"exists") then
			parse("sethealth "..id.." "..player(id,"health")-1)
		end
	end
end

How do I make the players hurt every 2 seconds or more seconds?

alt Re: Hurt every 2 seconds?

_oops
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
cnt=0
max_cnt=2 --  you can change here for more second 

addhook("second","_sec")
function _sec()
cnt=cnt+1
 if cnt==max_cnt then
 cnt=0
  for k,v in pairs(player(0,"tableliving")) do
  parse("sethealth "..v.." "..player(v,"health")-1)
  end
 end
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht