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)