Server Ping Skyrockets

For some reason when I start a round and after 20 seconds passes, the server ping starts to rise and does not ever go back down.

I don’t know why, but this issue only occurs when I start a round. If I join the game and just sit there, nothing happens.

What could this possibly be? Is this an issue with the client or the server? I’m assuming it’s the server. Is this a memory/data leak or whatever?

What specific things should I be looking out for to resolve this problem?

1 Like

For some reason it seems to have to be doing something with this section of the code when you first spawn into the round:

for i, v in pairs(game.Players:GetChildren()) do
	if v:FindFirstChild("TempStats") and v.TempStats.Ready.Value == true and v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health > 0 then
		v.TempStats.Spawned.Value = true
		local RandomSpawn = Random.new():NextInteger(1,#Spawns)
		v.Character.HumanoidRootPart.CFrame = workspace.Ignore.Spawns.Player[Spawns[RandomSpawn]].CFrame*CFrame.new(0,3,0)
		table.remove(Spawns,RandomSpawn)
		table.insert(Spawned,{Player=v,SpawnedBack=false})
		SupposeToSpawn = SupposeToSpawn+1
		RE:FireClient(v,"Spawn",{
			RoundStart=true,
			StartTime=MasterClock:GetTime()
		})
	end
end
1 Like

You can check the bandwidth of your game by pressing shift+f3, it will show you a debug dialog.
It can be find in overall:

GUI

1 Like

I sent 2-3 kb/sec when I spawn in, lol.

I doubt it’s an issue with remote events.

1 Like

You can try using FireAllClients outside the loop

1 Like

It needs to only fire specific clients, not all.

Plus, I disabled this line and it still happens.

1 Like

For some reason when I disable this line, this bug no longer happens. I don’t know why that single line is the culprit behind it all.

1 Like

What relies on that .Spawned.Value? Is it possible that something relying on that value, and sees a change, causes it to run extra steps outside this script?

1 Like

Can we see the code relevant to v.TempStats.Spawned.Value?

Setting it to true is causing the issue, so you probably have a memory leak or duplicate code running when the value is true.

It’s fine, i’ve fixed it. :slight_smile:

Heya,

If you fixed it, please put the code you used or solution here! It allows people with similar issues to look back at this thread and solve it like you have :slightly_smiling_face:

4 Likes