Random ping spikes after firing a remote to the server

Whenever I make a request to the server (FireServer or InvokeServer) it can randomly take a couple seconds for the request to be recived and my ping spikes really high, up to 1000+. Strange part is though, is it only happens inside of the actual game and not roblox studio, not even test servers on roblox studio. I’ve never had this problem before.

When ever you grab an item it fires a remote to the server.
You can also see when just opening the devconsole the ping spiked up.

Why is this happening and how can I fix this.

Can you show the script that fire the event?

I’ve already checked and its nothing to do with the script firing the server. I added a print statement right before the request and right when the server receives the request, it works perfectly fine, but sometimes with a major delay for no reason at all.

But here: Client

local Manager = require(game.ReplicatedStorage.Manager)

local Item = {}
Item.__index = Item

local RS = game:GetService('ReplicatedStorage')

local Manager = require(RS.Manager)

local GrabItem = Manager.Remotes.Item.GrabItem -- It isn't the manager either I tried getting the remote directly and nothing changed.
local GameSettings = Manager.Modules.GameSettings
local ItemInfo = Manager.Modules.ItemInfo


function Item.GrabItem(input, gp)
	if gp then return end
	if input.UserInputType == Enum.UserInputType.MouseButton1 then

		local target = mouse.Target
		if not target then return end
		if Item.Check(target) then
			if (target.Position-hrp.Position).Magnitude <= GameSettings.MaxItemDistance then
				local info = ItemInfo[target.Item.Value]
				if info.OnClick then


return Item


local Manager = require(game.ServerStorage.Manager)
local RManager = require(game.ReplicatedStorage.Manager)

local GrabItem = RManager.Remotes.Item.GrabItem
local Item = Manager.Classes.Item


GrabItem.OnServerEvent:Connect(function(plr, item)
	Item.Grab(plr, item)

But I’m really positive its not anything to do with the scripts, because it even happens with core scripts, like the dev console seen in the video

local connection
connection = GrabItem.OnServerEvent:Connect(function(plr, item)
    Item.Grab(plr, item)

Maybe, can you try disconnecting the function?