Forum

> > CS2D > Scripts > regen health? lua
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch regen health? lua

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

verschoben regen health? lua

Vennece
User Off Offline

Zitieren
those anyone have a regaining health with changeable
regen health please...

alt Re: regen health? lua

Ace Howl
User Off Offline

Zitieren
If you want to regenerate health each second:
1
2
3
4
5
6
addhook("second","second")
function second()
	for _, id in pairs(player(0, "tableliving")) do
		parse("sethealth "..id.." "..(player(id,"health") + 1))
	end
end
Note: after +, there is number 1, change the value for amount of regeneration each second.

Another tip:
If you want to regen health faster, change hook and function to ms100. If you want it to regen much faster, use always.

alt Re: regen health? lua

Alistaire
User Off Offline

Zitieren
If you want regen on a custom interval and custom health returned, use;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
interval = 250 --time in milliseconds between each health regen
amount = 2 --amount of health regenerated each regen

function customTimer()
	regen()
	timer(interval, 'customTimer')
end

customTimer()

function regen()
	for _,id in pairs(player(0, 'tableliving')) do
		parse('sethealth '..id..' '..(player(id, 'health') + amount)
	end
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht