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

Having an odd teleportation error?

No matter what Place ID I put in this script, the error is that it cannot find the game, (Yes I made sure they're in the same game Universe). Doesn't make sense to me.

local event = game.ReplicatedStorage:WaitForChild("TeleportTutorial")

local function onFired(player)

	
	game:GetService("TeleportService"):Teleport(1432182797, game.Players.LocalPlayer, {}, game.ReplicatedStorage.TeleLoading)

end

	
event.OnServerEvent:Connect(onFired)



18:23:24.566 - Teleport exception: HTTP 400 (HTTP/1.1 400 Bad Request) 18:23:24.579 - raiseTeleportInitFailedEvent: Teleport failed because Cannot find game server (GameNotFound)

2 comments

0

You can't use game.Players.LocalPlayer in a ServerScript, and you don't need to. Just use your already defined player you get from the remote event.

0

I already tried that, the problem is that it won't teleport because it can't "find" the game for some odd reason, it still doesn't work, local script or not

2 answers

its because you are in studio. upload and publish and try it, it looks like it should work.

7 comments

0

False

0

I hate how true and false are capitalized in python.

0

That's strange, it works for me. Try this in a local script:

0

game:GetService("TeleportService"):Teleport(1537690962, game.Players.LocalPlayer, {}, game.ReplicatedStorage.TeleLoading)

0

Also, how do you get the error, because when I use your place ID (which is in a diff universe) I don't get this particular error either (it just teleports to a seemingly empty place and hangs there, saying wrong universe). Is any teleport initiated at all for you? Also, are both places published (i guess so).. Sorry, only found a 2year old bug report describing similar issue but no solution

0

That bug report does mention however: "I set the place I've been trying to teleport to as the start place of the game, and now the game will not load at all. It says "Requesting Server" infinitely." This suggests maybe something is wrong with the place you want to TP to. Perhaps just a connection issue, but maybe something went wrong uploading?

Make the game its sending to active. If thats not problem, remove:

{}, game.ReplicatedStorage.TeleLoading

Thats in the code block below:

game:GetService("TeleportService"):Teleport(1432182797, game.Players.LocalPlayer, {}, game.ReplicatedStorage.TeleLoading)

Also make sure the code is in a ordinary script, not a local or module script.

2 comments

0

Not the problem

0

I've tried it with just game:GetService("TeleportService"):Teleport(1432182797)

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