So I've this NPC that's just supposed to chase a player. Originally, I spawned the npc server sided, however the pathfinding was very laggy. So, I spawned it client sided instead using the exact same module and it worked perfectly. Here's a demonstration of the difference. https://imgur.com/a/IpJumqR
This caused a problem, though, that when a new player joined the game they couldn't see the npc.
How do I allow this new player to see the same npc as the first? Or if that's not possible or really inefficient, how do I make the server sided npc suck less? (I'll edit this and add the code if that's the case)

5 comments
Its a much better idea to run the NPC server-side and just interpolate the movement client side. Its how pretty much all online games do it. I can see room for exploits if the NPC is entirely ran client-side.
Does that mean spawning it server sided and do all the movement client sided? I'm not entirely the most well versed in this but won't that cause a newly joined player to see the npc at a different location than another player? And also how do I have the client access something that's server sided?
Nevermind I think I got it
On my bomberman style game I usually make npcs walk with two steps each node. If he wants to go left, I teleport him halfway to the left node, check if something is blocking the way, if not then teleport to the end destination. The client check when an npc is added, create the npc actual model (server view is just a block), and bind a part:PropertyChangedSignal("CFrame") event to a tween.
This tween moves the model to the new cframe of the server part, with time=distance/walkspeed(*.8-.9 to make it a bit faster than the server moves, so it keeps up with the actual npc hitbox). I still have to implement it on PVP bots though, but if you want to see how it would be like in the end here's a video of the footage https://www.youtube.com/watch?v=BaO0DLZZ12g&t=40s