AntiKick Problem

Hello. I am trying to write a basic antikick script for my game. I have a basic system set up where as if I get kicked, I am instantaneously teleported back into the same game and server. But there is a problem with the script; it isn’t teleporting…

I was hoping for a better method to do this or perhaps an improved upon version of this.

AND FOR ALL CLARIFICATION: This is ran in a server script. I do not exploit personally.

local username = "Developer6786"
local tpservice = game:GetService("TeleportService")
local player = game:GetService("Players"):FindFirstChild(username)
player:LoadCharacter()

function rejoin()
		tpservice:TeleportToPlaceInstance(game.GameId, game.JobId, player)
end

game.Players.PlayerRemoving:Connect(function(playerL)
	if playerL == player then
		rejoin()
	end
end)

The server cannot tell the client to teleport to another game after the connection has ended. You should instead initiate the teleportation in a LocalScript (this would also eliminate unnecessary teleport attempts if the client disconnects in another way).

1 Like