Problem With Rejoin Script

  1. What do you want to achieve? Keep it simple and clear!

I want to rejoin my game after pressing the R key

  1. What is the issue? Include screenshots / videos if possible!

It works but when you get rejoined everything breaks such as The loading gui(play button to get rid of it never loads in),basically almost everything breaks

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have tried changing variables and looking in scripts for solutions, I have not tried the reserve server function for teleports as I want to rejoin a main public server, And yes I have looked for solutions on the developer hub.

Here is the script (It is located in starterplayer.starterplayerscripts)

local Player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")

UIS.InputBegan:connect(function(input)
	if input.KeyCode == Enum.KeyCode.R  then
game:GetService("TeleportService"):Teleport(game.PlaceId,Player)
end end)
1 Like

Try using this instead:
game:GetService("TeleportService"):Teleport(PlaceIDHere) – replace with ID of your place/game

Is it causing you error running this in Roblox Studio? Running teleport functions in studio is often buggy so you should be debugging and testing off of the actual Roblox game.

Also, you can press F9 while in-game to view errors and problems in the console:

I tried that as well but still the same thing, so my problem is that the teleport its self works 100% fine its just something about it that after you get rejoined the entire games scripts just stop working/pause in a way

Yes, I was doing it in the published game and not in studio

OK, try deleting everything in the player’s PlayerGUI via the server before forcing them to rejoin. See if the server adds the StarterGui back again after they rejoin.

You will need to add a Remote Function for this most likely.