how can i change lua to prevent turrets bullets push zombies back ?
Forum
CS2D Scripts Knockback turrets problmeKnockback turrets problme
4 replies 1
how can i change lua to prevent turrets bullets push zombies back ?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
addhook("hit","knock_hit") function knock_hit(id,source,wpn,hpdmg,apdmg,rawdmg,objid) 	if objid then return 0 end 	if knockpoint[source]>0 then -- CHECKING IF SOURCE PLAYER'S WEAPON IS BULLET-GUN 		if player(id,"team")~=player(source,"team") then -- CHECKING SOURCE'S TEAM 			kp=knockpoint[source] 			local distance = 1 			if distance then 				local rot = math.rad(player(source,'rot')-180) 				local xe, ye = -math.sin(rot)*distance*kp, math.cos(rot)*distance*kp 				xt = player(id,"x")+xe 				yt = player(id,"y")+ye 				parse ("setpos "..id.." "..xt.." "..yt) 			end 		end 	end end
1