Ping starts increasing continuously on my own games

So, I was doing some dashes and gun system on different games and I also coded them over 1 day. Then I play them on roblox. The first thing is. Everything is look completely fine, but after that. My ping starts to increase continuously without any decreasement.

Here’s the ping after around 1-2 minutes

image

Here’s the ping after around 10-15 minutes

image

Anyone could fix this or have the same problem like me?

1 Like

this happens when the server runs out of computing power
or you just have really bad wifi

does anything spawned by the systems destroy after it’s not needed?

Maybe it’s my computer power. I haven’t check it yet so I’ll test it out.

And I made the gun system, create new instance as a bullet, then add a hitbox on them. Destroy after it hits something. Maybe it’s another issue too.

This looks like a memory leak. You can use game:GetService("Debris"):AddItem(instance, seconds) right after creating the instance to make sure it gets cleaned up eventually even if something else in your script breaks.

The real fix for this would be to fix whatever in your script is causing the instances to not be destroyed (you probably are just forgetting to destroy something). For a gun system, I would also recommend using a raycast-based system instead of parts with physics.

Also, make sure there’s some kind of check to make sure the bullets don’t just fly forever. (Using Debris will cover that)

I was thinking of using raycast. But I already made a flying bullet just in a distance from character to bullet. And I used debris too. Maybe it’s because the script runs too fast on bullet part.

Ping also happens to my another game with dash system too, but not for other people.

check your scripts… if you connected events inside other events that can cause the event to be fired multiple times

ExampleEvent:Connect(function()
        part.Touched:Connect(function()
               print("Part touched")
        end)
end)

if you have something similar to this firing the example event twice can cause the touched event to fire twice.

look for issues similar to this one