In my game I have multiple NPCs (enemies) that each all have a server-sided script inside of them. This works really well for being able to fully customize the NPCs, although I’ve got a feeling that it might cause lag if there’s lots of NPCs.
The server scripts are slightly different, but all of them contain this:
–RunService.Heartbeat:Connect()
I use the loop to detect players within the NPC’s sight and it works fine. Again, my concern is that too many NPCs will cause the game to lag. I tested this theory, and from what I saw it does increase lag dramatically.
I’m not sure what to do, because server sided scripts inside each NPC is a lot easier for me to work with. Any thoughts?