Teleport Place GUI

  1. What do you want to achieve? I would like to create a GUI that whenever you click it, it would take you to another place in my game.

  2. What is the issue? The script I use just wont work and I dont get why

  3. What solutions have you tried so far? I spent around an hour looking for solutions but couldnt find any

local TeleportService = game:GetService("TeleportService")
Plr = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
	TeleportService:Teleport(7618728961, Plr)
end)
1 Like

Any chance you’re doing it in studio? Teleports don’t work in studio.

No, I am making sure I do it in the actual game.

Gotcha. Are you waiting a minute before you teleport? Teleporting to another place isn’t instantaneous, especially if there aren’t any existing servers.

Also any output errors?

I just tested it, it said “Invalid player to teleport”

Ah okay, are you using a server script? If so, you should switch to a localscript as players.LocalPlayer doesn’t exist on the server.

Sorry I am a little confused on what you are saying. It is in a non local script so you want me to change to a local script?

Yeah, switch to a localscript. The LocalPlayer property of the Players service doesn’t exist on the server.

Thank you so much! Your a life saver!

1 Like