Game teleport script doesn't work

Hello Everyone.

I’m working on some sort of big lobby where you can teleport to different, popular games.

The problem is that my script isn’t working.
I’ve tried out other scripts from tutorials etc. but they didn’t work either
here’s an example:
Anmerkung 2020-07-16 182713

It would be really helpful if someone could tell me what i need to do so it finally works.

1 Like

Not familiar with teleportation but maybe you should set the Place to the PlaceId that you want to teleport?

1 Like

Is that your script? If so you have the PlaceID as a random.

already did that. the 000… should just show where the ID would be

So show us what your script looks like now.

Have you read this? (Teleporting Between Places | Documentation - Roblox Creator Hub)

The place must be part of your game.

ok maybe the 000… ID was a confusing example.

here is the script with the ID of Adopt Me:
Anmerkung 2020-07-16 184330

but that didn’t work too

I would recommend having a debounce on the touched so it doesn’t fire multiple times.

local debounce = false

script.Parent.Touched:Connect(function()
    if debounce then return end
    debounce = true

    -- code here

    debounce = false
end)
2 Likes

Isn’t it possible to do it with other games too ?

That’s what i thought because the unofficial Egg Hunt 2020 lobby did it.

Were you testing it in studio? TeleportService doesn’t work in studio, only in real games.

1 Like

You are correct. My mistake. It is possible to teleport to other Starting Places of other games. Are you testing it in studio? It does not work in studio, you should publish the game and try to test it in Play mode.

I’ve published my Game and tried it out but it didn’t work.
Could it be that my Game needs to be public instead of private ?

It’s fine if your game is private but the game you’re teleporting the players to has to be public.

@DrMelonblox_YT

I’ve tested this and it should works just fine, Make sure the script is a Server Script and place it inside of the part

local tp = game:GetService("TeleportService")
local placeId = 142823291 -- id here

script.Parent.Touched:Connect(function(Obj)
	if Obj.Parent:FindFirstChild("Humanoid") then
		if not Obj.Parent:FindFirstChild("Deb") then
			local deb = Instance.new("BoolValue") ; deb.Name = "Deb" ; deb.Parent = Obj.Parent
			game:GetService("Debris"):AddItem(deb, 1)
			local player = game.Players:FindFirstChild(Obj.Parent.Name)
			tp:Teleport(placeId, player)
			print("Teleporting ", player.Name, " to ", placeId)
		end
	end
end)
1 Like

The only scripts i can find are Script, Local-& ModuleScript.

Do i need to put the code into the ServerScriptStorage ?

Is it in a local script or normal script?

Ignore this I didn’t read the full thread first like a noob. Deleting

1 Like

A Server script is a normal Script I said Server Script so you wouldnt use a Local Script

image

1 Like

Do i need to change something up in the code ?

Just asking because there’s something with Debris

Just copy paste the code and you’ll be good, Debris is to add debounce only to the person that touched the part, all you need to change is the PlaceId dont worry about the rest,

1 Like