Forum
CS2D Scripts Attacking ImagesAttacking Images
1 reply 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("attack","checkenemies") function checkenemies(id) 	local rad=math.rad(player(id,"rot")) 	local sin=math.sin(rad) 	local cos=math.cos(rad) 	local range=128 --range how far to shoot (in px!) 	for x=1,cos*range do 		for y=1,sin*range do 			for enemy=1,256 do 				if (enemyexists(enemy,x,y)) then 					hitenemy(enemy,dmg) --dmg is damage dealt to enemy 				end 			end 		end 	end end
It may need some fixes, I wrote this 8 AM in the morning, just woke up.
1