If you put print("clicked") under that script.Parent.MouseButton1Down:Connect(function() line, does it print when you click the button?
Are you running this in studio or a live game server?
Now that I’m looking at your code, it looks like you’re giving the :Teleport method the GAME id, not the PLACE id. Open the “Game Explorer” from the View tab in Studio and open the “Places” folder. Right click the place you want to teleport them to and click the “Copy place id” button and use that instead.
The steps I have at the end should still solve your problem. Roblox does not know which place to teleport them to if you just give the game ID - games can have multiple places.
local button = script.Parent;
local gameId = 0 -- Change it to your game ID.
local function on_Click()
local teleportService = game:GetService("TeleportService");
local succed, stringError = pcall(function()
teleportService:Teleport(gameId, game.Players.LocalPlayer)
end)
if succed then
warn("Succed to teleport player.")
else
warn("Failed to teleport player: ".. stringError)
end
end
button.MouseButton1Click:Connect(on_Click)