I have a detection system in a bot which is supposed to detect players. How it works is it creates a massive invisible and non can collide sphere around the bot and then whenever this hits [DetectionSphere.Touched:Connect(function(hit)] a part with the name ("Head") it locks onto it and begins firing. For some reason this system only works sometimes, and after a lot of head scratching I decided that it must be something to do with the touched:Connect. (I have had problems with this in the past). My question is is there any better way to do this? I am not requesting that you write a script for me, just give me some guidance.
P.S. I have asked about this before and my script is here https://scriptinghelpers.org/questions/78614/auto-firing-system-having-trouble-detecting-characters but it is really long and tends to scare people away from my question. I only want some pointers on how to correctly make a detection system, but if you really want to you can look at my script.

4 comments

0

Try using a loop with magnitude instead?

0

magnitude?

0

ok i will try

0

Thanks! This is exactly what I needed!