Forum

> > CS2D > Scripts > anyone knows when wearing an stealth armour....
Forums overviewCS2D overview Scripts overviewLog in to reply

English anyone knows when wearing an stealth armour....

6 replies
To the start Previous 1 Next To the start

old anyone knows when wearing an stealth armour....

robed
User Off Offline

Quote
while wearing stealth armour. you dont get damaged with any attacks


i cant get it to work?
1
2
3
4
5
6
addhook("hit","samplehit")
function samplehit(id,item)
	if item == 84 then
               return 1
        end
end
edited 3×, last 06.06.12 03:07:14 pm

old Re: anyone knows when wearing an stealth armour....

DC
Admin Off Offline

Quote
Looks like you are using random paramters for the hit hook. That doesn't work. The actual paramters are: cs2d lua hook hit
What you're calling "item" is actually the player id of the player who causes the damage.

The armor id will never appear in the hit hook as parameter anyway.
Try the following condition in your hit hook.
1
2
3
if player(id,"armor")~=20X then
	return 1
end
20X is the armor value when wearing the stealth armor. I don't know exactly what value it was. Maybe 205 or something. I don't know. Print the value to the console to see it and afterwards put it in the script to make it work.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview