You need to use the profiling tools to see what is consuming time, which unfortunately I’m not very good at. A really easy way to slow a game like this is to have too many threads, though. Is there any mechanism which adds/copies scripts in your game? Or anywhere task.spawn can be called?
there is only one mechanism which copies scripts in my game for now, but I am very sure that the script will be deleted once it is done being used, task.spawn(), I used it a lot as well as task.wait()
I was doing some more researchs, maybe it is because I am using Debris Service ?
You should add some code to track each time a script is created and destroyed and print a count, if it keeps going up, then there’s a problem. You can make a counter for this using a module script.
I will do it but I don’t really think this is the main problem, the script which copies this script is an event script, it only has 25% chance to copy for the event, so there was a server WHICH the event never happended in but it is still getting laggy over time
I have no idea if that would matter without knowing much more about what you’re doing with that. You shouldn’t have tables that could grow in size with no limit, but the profiler will tell you that in the form of memory.