How to damage close enemies by facing them?

Hello everyone! as the title says, What i really want to make is illari’s weapon, when she heals and points the heal towards the enemy, i want the enemy to get damaged, like when she faces them BUT what i want is to damage the only enemies that are close to her , not in the end of the map for example, so i already made this workshop here is the code HFYMP Everything works great except when i make a dummy bot near me and a second one lets say he’s very far away, the game will automatically consider the dummy bot beside me as the same one as the very far away dummy bot, and the far away bot will get damaged, and i don’t want him to get damaged since he’s too far away, how can i get this fixed? Any help would be appreciated! thank you so much for you’re time reading this! Hopefully it is simple to fix!

Eye Position(Event Player) == True;
Eye Position(All Living Players(All Teams)) == True;
Remove From Array(Players Within Radius(Event Player, 20, All Teams, Surfaces), Event Player) == True;

these all do nothing… I’m 99% sure, I mean your checking if a Position/Array is = to true?
(assuming it either always returns true, which makes it redundant or it always returns false which blocks the script entirely)

(was tested in-game, it does work, took about 2m to make)
either way all you really need for this is

"rule(“Illari Damaging, Heal Beam”)
Ongoing - Each Player;

	"Checks if Hero is Either a Duplicated Illari or Illari"
	(Is Duplicating(Event Player) ? Hero Being Duplicated(Event Player) : Hero Of(Event Player)) == Hero(Illari);
	"Checks If Secondary Being Used"
	Is Firing Secondary(Event Player) == True;

	"Damages Enemy The Illari Is Looking at the hitbox of Within 20 meters for 10 Damage (10 Damage Every 0.1s = 100/s)"
	Damage(Ray Cast Hit Player(Eye Position(Event Player), Eye Position(Event Player) + Facing Direction Of(Event Player) * 20,
		All Living Players(Opposite Team Of(Team Of(Event Player))), Event Player, True), Event Player, 10);
	"Damage Cooldown Before Next Loop"
	Wait(0.100, Ignore Condition);
	"Loop Damage"
	Loop If Condition Is True;


(does damage through other Players but only Damages if beam inside them)

if your on PC you can just Copy Paste this Code into the Workshop, if not just try recreating it.

Hey Spiderman318! Thank you so much for you’re time and you’re help! i was wondering if you were able to send a code for this one, i’m sorry! i tried to copy everything on the workshop but i got stuck in the middle not knowing which position is the right place, if not that’s alright! i’ll try to figure it out

yea thats fine, Code is “P4TQA”
also it doesn’t hit through enemies (was wonder why that was happening.)

it was because i never deleted your script only added mine. everything is working as expected now that i’ve removed that script

Oh i see! Thank you so much for you’re time , much appreciated! <3