My game crashes randomly

Note that this does not cause any type of lag in my other worlds. in fact, im sure a loop like this shouldnt cause lag at all, since its just a for loop, but it drops my frames every 2 seconds

after further testing, i still crash after replacing all of my custom waits with task.wait()
i do not have any while true do scripts on the client, only while wait(n) ones, or ones with while wait(n) inside of the loop. Everything also seems to be fine up until the crash. my character can be just walking around (after dying) and it just crashes

If that’s the case, maybe it’s the Roblox servers or something? I mean, the servers literally crashed like 3 weeks ago. I don’t see them fixing them the full server problem in just 3 weeks. If they were to fix it fully, then probably should take about 2-3 months. Again, I’m not an engineer, but my guess.

So, in conclusion I’ll end up saying players have been crashing randomly for the Roblox Server problem.

Awe, yea i hope it isnt a roblox issue. Although i never seen this happen to any other game. I also have new information, the crashes seem to happen when a new player joins the game. It happends inconsistently so its hard to say / replicate, but when a player joins, 1,2 or even 3 people just crash

Sorry for the late reply, but I think the reason behind that is, you’re making adding way too many stuff when the player joins. Might be the issue I’m guessing. But again, servers are still a little down, so let’s see what happens a few days later. Anyways, can you give me the game link so I can check it for myself?

If you don’t mind me asking, what kind of game is it?
Just helps understand what could be causing it.

https://www.roblox.com/games/5882146099/Testing-Your-Hero-Academia-Ver-0

we are going into stress test soon. also you need to be in the group to have access

it is a game based off of my hero academia, created by Kohei Horikoshi

Also, this issue is still persisting even today, so it might be the ladder but, i guess it would be the case if the player who joins crashed, but it does the opposite, other people crash when a player joins. Im not sure if its exclusive to player joining either

Watch your memory usage in dev console, does it go up overtime? Is the crash on the client or server? If client than watch your CPU usage in task manager and see if it goes up over time.

How cani tell if the crash is client sided or server? i think it is client because only specific people crash during it, i could be wrong though. If it is client does this mean it is caused by a client script?

I ask this because knowing where to look for memory leaks / infinite loops is good

Yeah if its in a client script than its a client crash. Disable any suspect scripts and disable them and see if the crashes persist.

The thing is the crash is hard to replicate. The crash happends only in public servers with other people in it, and a random chance of it crashing when someone joins

What scripts do you have that have a player added event or iterate thru players?

Many, the performance heavy one that i can think of, off the top of my head may have to be the custom character script. Although that has always been their and i never had any issues before.

Check that none of your scripts has a to short “cooldown”. Example:

while true do
    print("E")
end 

Fix:

while true do
    print("e")
    wait(0.001)
end