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

Why does this Script not Teleport the player?

Hey. I am currently having a problem with the Teleport. (Sadly at release of the game :( )

This Script is located in a LocalScript in a TextButton.

In Studio it says "Cant Teleport in Studio", but in Roblox Player it does nothing.

Script

script.Parent.MouseButton1Click:Connect(function()
		local TeleportService = game:GetService("TeleportService")
		local placeID_1 = 3718647234
local Players = game:GetService("Players")
local player = Players.LocalPlayer	
TeleportService:Teleport(placeID_1, player)
end)

2 answers

Just replace the "PlayGST.MouseButton1Click:Connect(function()" with your button


local Player = game.Players.LocalPlayer
local ID = "UR ID"
local TS = game:GetService("TeleportService")
local PlayGST  = script.Parent.Parent.PlayCT

PlayGST.MouseButton1Click:Connect(function()
	print("hit")
	TS:Teleport(ID, Player)
end)

I believe the issue you are having is because you are inputting a player value when it’s not required (assuming that this is a localscript).

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