I have very few tools to help me combat memory leaks in my game. The loops exit appropriately btw and the unused models get deleted and the round restarts.
THere’s a black box called Garbage Collection Info which does gcinfo(count) i think and it stays at a small number around 9000. Which i’m sure is good but i dont understand it at all.
I exit loops that are not needed.
I have tried many things and at this point I have no clue what is going on in my game that is causing it to crash.
I have manually set variables to nil and I know my while loops are super carefully coded to not run forever.
No, ROBLOX does not offer any support to fix code. This is something you have to fix yourself. You can post part or all of your code depending on how long it is in #help-and-feedback:code-review and someone may take the time to read it and help you out. If you can’t figure it out after awhile you might want to consider hiring a scripter to help out as a last resort.
while (#players > 1 and not game:GetService("RunService"):IsStudio()) or (game:GetService("RunService"):IsStudio() and #players > 0) do
if PlayerIsNearEnd(players) == true then
print("the condition to generate a new stage is true")
LastGeneratedStage = game.ServerScriptService.GenerateNewStage:Invoke((LastGeneratedStage)) -- we are using the laststage to put before.
end
task.wait(1)
end```