Help with unworking teleport script

So basically I made a gui button with a local script that is supposed to tp you to another game

Local Script:

local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
local fade = player:FindFirstChild(“PlayerGui”):FindFirstChild(“Fade”)
while true do
fade.Frame.BackgroundTransparency = fade.Frame.BackgroundTransparency - 0.1
wait()
if fade.Frame.BackgroundTransparency == 0 then
game:GetService(“TeleportService”):Teleport(4616652839, player)
end
end

end)

I’m pretty sure if you are using a local script you do not need to add the player argument when you are teleporting so you can just try the code below.

game:GetService("TeleportService"):Teleport(4616652839)

But it seems pretty cool, good job!

thanks will try it later


1 Like

So does the you’re going to teleport from need to be public?
because it’s not working

Well first you can only use teleport service in a actual game, so you cannot test it in studio and the game has to be accessable to you, eg: a game you own or one that is public.

I have been playing it in an actual game and the other game is accessable to me, maybe i need to wait longer?

Check the output menu for errors, also I recommend using TweenService rather than a while true do loop.

Heres what i see on the output

https://streamable.com/70cz0u


I believe you need to enable third party teleports in settings, if you haven’t already.

holy crap didnt know that was a thing thanks

I turned it on, nothing happened

Nevermind just noticed what the description says

1 Like