In my game, in a server script I have all the enemies as tables with all of their stats, AI type and their position, put in another table that holds them. The script loops through this table every heartbeat and moves them forward based on their speed.
Every 10 heartbeats, I use a remote event to fire this table to the client to render and tween the enemies and smoothly move them to their new positions or to show status effects purely on the client to save on server performance.
The issue is, I don’t have any idea on how I would identify if a mob is newly spawned, and how I would assign a model to that specific enemy if it is newly spawned. I also don’t know how I would keep track of all of the enemy models in a way that doesn’t get confused for another enemy of the exact same type/name.
I’ve tried looking for similar posts, but I couldn’t find anything helpful.
If anything needs further explaining, please ask.