Example
when i toggle to open flashlight to kill my nearby enemies
please make me one or give example flashlight can kill enemies to me
THANK YOU EVERY ANSWER
range = 100 -- range within which the torch will kill enemies addhook("flashlight","killtorch") function killtorch(id,state) 	if state==1 then 		for _,iid in pairs(player(0,"tableliving")) do --check all players that are alive 			if iid~=id then --if the player being checked isn't the torch activator 				local ix=player(id,"x") 				local iy=player(id,"y") 				local iix=player(iid,"x") 				local iiy=player(iid,"y")	 				if ((ix-iix)*(ix-iix)+(iy-iiy)*(iy-iiy))<=range then --mathematical formula for checking distancethen kill player 					parse("customkill "..id.." Torch "..iid) 				end 			end 		end 	end end
range = 100 -- range within which the torch will kill enemies addhook("flashlight","killtorch") function killtorch(id,state) 	if state==1 then 		for _,iid in pairs(player(0,"tableliving")) do --check all players that are alive 			if iid~=id then --if the player being checked isn't the torch activator 				local ix=player(id,"x") 				local iy=player(id,"y") 				local iix=player(iid,"x") 				local iiy=player(iid,"y")	 				if ((ix-iix)*(ix-iix)+(iy-iiy)*(iy-iiy))<=range then --mathematical formula for checking distancethen kill player 					parse("customkill "..id.." Torch "..iid) 				end 			end 		end 	end end