Are there any scripts that call clone / Instance.new often.
Well, the scripts that manage the buildings (the aim of the game is to demolish buildings) clones up to 100 parts when the building is destroyed but this has never caused performance impacts before and the lag happens randomly. I tried timing the intervals between the spikes just now and it seems to be completely inconsistent. As for instance.new, no this is not called very regularly at all.
Are there other players in your game or are you the only player?
I have tried with one of my friends on and the lag was the same as with just me on the server.
Check through your scripts, is anything ‘performance heavy’ running?
Let me have a check through everything…
Just did an interesting little test, I don’t think my friend was reporting back to me accurately when he came on with me because I joined on my phone and it lagged at different points to my PC. I assume that the lag must be being caused by a client side script so I will check them all now.
@Abcreator Just got a photo of the lag spike with the micro profiler. I’ve never really used it before and don’t understand what it’s readouts mean but hopefully it can help you help me find the problem, here is the photo I took.
I can’t see any weird things here, is the memory crazily high?
No, it’s the cpu that goes very high, memory and gpu stay stable, cpu fluctuates to max load.
Then it’s a local script, it seems.
Alright, I’ll check them all over thoroughly, I also took a frame by frame video which I might as well show you while I do that.
@Abcreator So, I have done lots and lots of testing and I seem to have reduced the lag through changing a couple of performance intensive server side scripts (I couldn’t find any problems client side) and the main thing I’ve noticed which I wanted to ask you about is when it lags, the microprofiler seems to go mad, loads of tasks as generated (as shown in the clip above) and I was just wondering what this means exactly.
On top of this, I just checked a couple of my other games and that unknown script is barely active in them. This makes me think I have got some kind of major problem (maybe even a virus?).
It could be that that script is set to only run in certain games.
At this point I am completely clueless as to what is going wrong and how to fix it, I see no major or obvious problems with any of my scripts. Is it possible that a virus is hidden in my game somewhere?
Sorry if I’m starting to get on your nerves but I just tried to run a server side script which listed all the script instances while the game was running and got a rather unusual error, I looked it up and there aren’t many topics on it and they are all to do with exploit issues. Here’s the error anyway: 19:44:14.450 The current identity (2) cannot Class security check (lacking permission 6) - Server - Tool_Manager:27
This is because your script tried to access a RobloxLocked instance.
Right so its nothing dodgy im assuming. There must just be something inefficient running that I haven’t found yet, I’ll keep looking.
So, I fixed the lag. I have spent days trying to work out which script had a performance intensive task in it or whether I had a virus. It turned out I had forgotten to anchor several large parts and this was the source of the random spikes. I am relived that it’s nothing serious or hard to fix but also furious that I missed something so simple. Thanks for everyone’s help.