Excessive lag and Infinite Yield Possible

When we join the game, it takes too much time to load and then it is just lagging for a few minutes like heck! I’ve asked many developers and people for help but they just keep asking to remove some scripts, meshes and etc…

We tried to remove TONS of scripts, meshes, parts and other things but it did not really affect too much on the game, it just still lags and sometimes breaks/glitches the game due to the lag of some people. The chances have reduced of the game being glitched but it still happens… Is there anything else we could try? I’ve made more games and I put high details in the other ones but this never happened.

Any idea what we can do apart from removing things? We’ve tried it already… :frowning:



The game works fine for some people but the chances of getting glitched are high, you can play it yourself here…Slay 🔪 [MOVED] - Roblox

2 Likes

You may have viruses if you used any free models, or if you have bad plugins.

The game’s not too laggy for me and i’m on a very low-end PC.

Although i would say, there is quite a bit of ping for my internet, There could be some latency issues as you have alot of scripts running on the server, Try optimize your code, clean up debris every now and then (if you have un-anchored parts)

This doesn’t sound like a virus, as there’s no errors in the console, and the performance is not that bad.
When it says infinite yield possible, it’s just alerting you that the infinite yield is possible, it may not occur.

No free model or plugins used AT ALL! Whatever you see and whatever is there in the game is totally 100% made by me and my scripter.

We optimized the code a lot and checked almost everything. Popular big developers even failed to help us but we still trying to find a way… :frowning:

My games are almost never laggy since I follow this dev forum post.

That might not be useful in this case since you said you have optimized every code in your game so perhaps check every detail in game and check for extra parts you can remove and resize other ones.
Try not to use extra ScreenGui since that effects too.
Firing many remotes at same time would cause lag aswell.
Instancing would be one of the best lag reductions I use.

The infinite yields are not as concern as they are apart of the Roblox Core Gui scripts, and are thus out of your control but also nothing to worry about.

As for the performance: under the view tab of studio, open up the script performance element, run a play test, and observe/debug which of your scripts are taking up to much resources.

Try to avoid over-instancing (using clones of scripts) in to many object at a time, or atleast try to package them a little more optimally.

You should also ensure that you optimize collision fidelity to avoid overly dense pockets of physics that tend to slow things down as you get closer to them, or start moving other object near.

You can also observe the summary, render, network, and other stat elements under the view tab to diagnose where you are losing performance. Whether it’s render related, physics related, or network related. It’s a great set of tools to help finding problems.

2 Likes

If you want, i can help check the scripts for you and we can chat on discord.
If not, i’d just recommend you re-make the core-scripts for the game and keep the following in mind:

Lower the amount of loops and threads running.
Reduce everything so it isn’t as performance intensive.

Try lower the amount of lines you can do something in (and make sure it’s not intensive)

Adaptabil#8713

1 Like

Show us what your code is doing in the Script Preformance tab of Roblox studio.

1 Like

We have tried almost everything, script performance and everything is all okay. We moved our game to a new place here Slay 🔪 [CANCELLED] - Roblox and it was working smoothly and perfect for the first few hours but suddenly, now it is starting to lag and act like the old one, we moved all the badges and even uploaded the video on the game page after seeing that the game is working smoothly but well I guess that robux just got wasted because this one is lagging again too… We did not even change anything since the morning, it was just perfect and then now it’s lagging again :frowning:

1 Like

You probably have a TON of memory leaks.
I would look into fixing those.

1 Like

Got Discord? Add me: Eco Crash#1000

1 Like

Sorry, I wasn’t clear. When I said, “I would look into fixing those,” I meant you should look into it. Apologies for the inconvenience.

1 Like

Infinite yield happens when :WaitForChild() can’t find the child you want in 5 seconds. You should set a timeout, for example:
:WaitForChild("Part", 5) - This would wait for the child “Part”, and if it can’t find it within 5 seconds, it will skip over it. As other people said, it seems to be Roblox core scripts, so you can’t do much about that. The error at the end is fixable by you though.

In terms of the excessive lag, people said it could have been a memory leak, do you have a lot of loops without a wait/yield? This usually causes most of the excessive lag issues for me.

1 Like

I believe I have the same issue with this problem since yesterday, still discovering problems why (“CanChatWith”) obviously, some odd reason chat will not respond…
https://gyazo.com/254aff2f9e7e7d51550d3099b6bc5422
chat text seized while testing my game. https://gyazo.com/271e8920a01dfaa763f733610a8be589

1 Like