Weird error in messaging service

I am getting this weird error in my game.
https://prnt.sc/qoypnv

I have a command in my game to reboot all servers for update. It was working perfectly fine until I published the game. All I did was add one line in the Leaderstats script. Didn’t mess with ANYTHING else, and now I am getting this error.

How can I fix this. Help is appreciated.

If you remove that line does it remove(the error) ? Can I see the script too?

This is the script:

local MessagingService = game:GetService("MessagingService")
local RunService = game:GetService("RunService")
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")

local Reboot = game.ReplicatedStorage.RebootEvent

local rebootText = "all servers"

local function callBack(serviceData)
	for i = 10,0,-1 do
		Reboot:FireAllClients("Rebooting "..rebootText.." for update. Please wait.("..i..")")
		wait(1)
	end
	
	Reboot:FireAllClients("Rebooting...")
	
	wait(2)
	
	if ((#Players:GetPlayers() == 0) or (RunService:IsStudio())) then
		return
	end
	
	local reserveCode = TeleportService:ReserveServer(game.PlaceId)
	
	TeleportService:TeleportToPrivateServer(game.PlaceId,reserveCode,Players:GetPlayers())
	
	Players.PlayerAdded:Connect(function(player)
		TeleportService:TeleportToPrivateServer(game.PlaceId, reserveCode, {player})
	end)
	
	while (#Players:GetPlayers() > 0) do
		wait(1)
	end	
end

Players.PlayerAdded:Connect(function(plr)
	if (plr.UserId == game.CreatorId) then
		plr.Chatted:Connect(function(msg)
			if (msg == ".rebootAll") then
				MessagingService:PublishAsync("Reboot")
			elseif (msg == ".rebootThis") then
				rebootText = "this server"
				callBack()
			end
		end)
	end
end)

MessagingService:SubscribeAsync("Reboot",callBack)

Edit: Removing that line doesn’t resolve the issue.

Which one is the said line of code?

The line was something like this:

if (plr:FindFirstChild("leaderstats")) then return end

Changing the name of the event from Reboot to something else fixed the issue.

It’s a bug in Roblox. Not in my script.