Player:Kick() fails to kick player while Teleportation Error is still on players screen

Player:Kick() fails to kick player while Teleportation Error is still on players screen

When you try to kick a player when the TeleportInitFailed message is on the player’s screen, it fails to remove the player from the server.

Repo:

  • Add the code below into ServerScriptService or download the place file and publish the game
  • You must join the game with the player for the TeleportAsync event to work
  • Teleporting the player from the client also works
local TeleportService = game:GetService("TeleportService")

local function onPlayerAdded(player : Player)
	TeleportService:TeleportAsync(34524324, {player}) -- Random Place ID that I do not own to force an error

	TeleportService.TeleportInitFailed:Connect(function(teleportPlr : Player) -- On any teleport fail
		if player.UserId == teleportPlr.UserId then -- Confirms that the failed player is the same person
			player:Kick() -- This is AFTER the teleport async
		end
	end)
end

game.Players.PlayerAdded:Connect(onPlayerAdded)

KickBug.rbxl (36.1 KB)

Demonstration

New information:

5 Likes

Update:
I did some more research and found that the player is removed from the server as the server does not update the client, but the client is still running, not closing/shutting down like in a regular player:Kick() call.

As seen in this video, the baseplate that was changing to a random brick color by the server stops after the kick and chat messages fail to go through.

Does this mean it’ll look like when you lose connection to the server? By that I mean every server sided scripts, players are completely frozen but client sided stuff still works?

From my tests yes, but it’s pretty easy to replicate if you want to try it yourself. Just copy and paste the original code snippet into a server script and join the game.

Thanks for the report! We’ll follow up when we have an update for you.

1 Like