[Maybe fixed] Remote event invocation queue exhausted

[ MAYBE ALREADY FIXED ]

So I’ve got this head turning script in my game Wolves Life but after a recent update to roblox studio-- this happens:


This lags the whole player out in the worst case, this does not happen to the people joining (1-5 people) but over that it starts to happen… we’ve got 3 scripts handling this.

This is the Script. There should not be anything wrong with the local turning script either and sometimes it says it does not find the Neck/Torso part in my model.

local TweenService = game:GetService("TweenService")

local targets = {}

game.ReplicatedStorage.HeadTurn.HeadUpdate.OnServerEvent:connect(function(player,neck,torso)
	targets[player.Name] = {neck,torso}
end)

game.Players.PlayerRemoving:connect(function(p)
	targets[p.Name] = nil
end)

while wait(.2) do
	game.ReplicatedStorage.HeadTurn.HeadUpdate:FireAllClients(targets)
end

this is a part of the head turning script I got

while wait(.2) do
	if player.Character:FindFirstChild("Neck") then
		game:service'RunService'.Heartbeat:wait()
		game.ReplicatedStorage.HeadTurn.HeadUpdate:FireServer(neckpart.Motor6D.C1,torsopart.neck.C0)
	end
end

Does anyone have a clue what is going on? Ask away if there is any information I left out

1 Like

You’re firing the remote events too much. More info on it here. Could the server instead just check for the head? If you’re making an antiexploit your real threat here would be server sided movements.

Yeah, this has nothing to do with a Roblox Update.

As iRexBot stated, you’re “exhausting the remote event invocation queue”, which is fancy speak for you’re going too fast.

Try using Network Ownership. If the part is unanchored, network owned by the player, and you weld it all locally, then you won’t even need this event.

Network Ownership is still confusing to me. I don’t know why as ii’s easy but it’s confusing for some reason

The tl;dr of it - if your client owns a part, and it’s unanchored, the client can move it around wherever it wants and that’ll replicate

I get it now. So having a part’s network ownership towards a client will allow the client to move it on the client side at the same time replicating on the server side but if the ownership is towards the server then if a client moves that it won’t replicate? Is this correct?

Is there an OnClientEvent implementation? It does not look like that many calls of FireAllClients should cause a problem.

That’s what I was going to say. I imagine shooters fire events way more rapidly than 5 a second, hell I’m pretty sure I fire events way more rapidly than 5 a second.

1 Like