I have tried everything from other devforum articles such as:
and many more.
However, none of these have worked for me.
I have no loose humanoids, no while trues, and it still lags when the player dies.
If you know any other optimization methods, please let me know
TLDR: it works fine in solo playtesting in studio, but when we do a teamtest or play in roblox when one person dies the game freezes for some seconds, please let me know any ways to fix it
He mentioned it was exclusively when a player dies/resets but if the respawn time is 0 then yes CharacterAdded events could also be contributing to the observed lag.
and theres 1 result for the .died function, but this is just to remove the viewmodel when a player dies, as i move it to the workspace so it is visible
I have just tried this, and it still happens
what i did:
for each :connect() i made it a variable and when the player dies it disconnects all of them, and the stuff all still works, but when you reset or die by other means it still lags, did i do something wrong doing it like this or is this how it should be?
editing quick to say that im going to take a while to try to figure it out by process of elimination