Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I need help with making a working teleport Gui that takes you from game to game?

I have tried a lot but I still cant get a working Teleport GUI, and by that I mean one that teleports you to different places. Here is what I tried

local TeleportService = game:GetService("TeleportService")
local gameID = 1559604744


script.Parent.MouseButton1Click:connect(function()
	print("HI")
	if player then
        TeleportService:Teleport(gameID, player)
end)

please help me and thanks

1 answer

Hello, turbomegapower12345!

I know why your script isn't working, It must be a Local Script and must have a variable that reffers to player!

Example of working one:

local TeleportService = game:GetService("TeleportService")
local gameID = 1559604744
local player = game.Players.LocalPlayer


script.Parent.MouseButton1Click:connect(function()
	if player then
        	TeleportService:Teleport(gameID, player)
	end
end)

This don't will teleport if you're in studio, must be a server!

Good Luck with your games!

2 comments

0

Oh, thanks so much, I have one more question. Does it have to be in Starter Player Scripts?

0

No, it have to be on the gui you want the player to click

This discussion is preserved as it was. New answers, comments, and votes are closed.