Forum

> > CS2D > Scripts > Turrents hit
Forums overviewCS2D overview Scripts overviewLog in to reply

English Turrents hit

12 replies
To the start Previous 1 Next To the start

old Turrents hit

tos12345678
User Off Offline

Quote
I need script to turrents don't hit survivors (accident) in Zombie
> But zombies soo...

old Re: Turrents hit

GeoB99
Moderator Off Offline

Quote
Not sure what do you mean exactly but if you meant this, try with this code below.
1
2
3
4
5
6
7
8
9
10
11
Turrets = {8, 11, 12}

addhook("hit","_hit")
function _hit(id, hpdmg)
	for k,v in ipairs(Turrets) do
		if team == 2 then
			parse("sethealth "..id.." "..player(id,"health") - (hpdmg + 0))
			return 1
		end
	end
end
Otherwise if this is not what you want, then could you please elaborate with what you said in the OP?

old Re: Turrents hit

SQ
Moderator Off Offline

Quote
@user GeoB99: The code is totally wrong imho. From parameters to everything.
Turret weapon id is somewhere near 255. Just return a hit when that happens.

old Re: Turrents hit

Cure Pikachu
User Off Offline

Quote
Turn off friendly fire? Unless the turrets has no team then:
1
2
3
4
5
6
addhook("hit","immunetoturrets")
function immunetoturrets(id,src,wpn)
	if wpn == 253 then
		return 1
	end
end
If this doesn't work then check if you have any other scripts that use the cs2d lua hook hit hook, especially ones that do return 1.

old Re: Turrents hit

SQ
Moderator Off Offline

Quote
...

1
2
3
4
5
6
addhook("hit","immunetoturrets")
function immunetoturrets(id,src,wpn)
     if wpn == 253 and player(id,"team") ~= player(src,"team")  then
          return 1
     end
end

old Re: Turrents hit

Cure Pikachu
User Off Offline

Quote
1
2
3
4
5
6
addhook("hit","immunetoturrets")
function immunetoturrets(id,src,wpn)
	if wpn == 253 and player(id,"team") >= 2 then
		return 1
	end
end
And it's called a turret.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview