Forum

> > CS2D > Scripts > Infinite Health in X Second
Forums overviewCS2D overview Scripts overviewLog in to reply

English Infinite Health in X Second

7 replies
To the start Previous 1 Next To the start

old Infinite Health in X Second

Eternal
User Off Offline

Quote
Hi guys! i want infinite health in x second
Example: player A have infinite health in 10 second
if player B hit player A,player A isn't die because infinite health when finish 10 second player B can hit and kill player A,player A can get damage from player B or other player.
Can you make me this script?
Thank you for answer

old Re: Infinite Health in X Second

DC
Admin Off Offline

Quote
use the hit hook and return 1.
use a variable to save which player is currently invincible and a timer to switch every x seconds. done.

old Re: Infinite Health in X Second

Apache uwu
User Off Offline

Quote
Ah, he wants a timer-ed shield...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("say","_say")
addhook("hit","_hit")

protected={}

function _say(id,message)
	if message=="give me inf" then
		protected[id]=os.time()+10
	end
end

function _hit(id,victim)
	if protected[victim]~=nil and os.time()<protected[victim] then
		return 1
	end
end

Untested, but the idea is correct.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview