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

TeleportService works on main place and not in the other place?

Touch brick that creates an apartment and then TPs you. This works.

game:GetService('TeleportService').CustomizedTeleportUI = true
 
ds = game:GetService("DataStoreService"):GetGlobalDataStore()

local handler = game:GetService("AssetService")
local db = false

script.Parent.Touched:connect(function(hit)
local h = hit.Parent:FindFirstChild("Humanoid")
if h  and db == false then db = true
local p = game.Players:FindFirstChild(h.Parent.Name)
local createPlace = handler:CreatePlaceAsync(game.Players:FindFirstChild(p.Name).Name.."'s Apartment",445919249)	
wait(1)
game:GetService('TeleportService'):Teleport(createPlace,p)	
db = false	
end	
end)

Clickable button in the Apartment place thats supposed to take you back to the main game.This doesnt work and gives a local error.


game:GetService('TeleportService').CustomizedTeleportUI = true


script.Parent.MouseClick:connect(function(p)
wait(2)
game:GetService('TeleportService'):TeleportToPlaceInstance(372961598,1,p)
wait(2)
	
	
end)

Error I get from Local Output : Teleport exception : HTTP 400 (HTTP/1.1 Bad Request)

2 comments

0

What line is it on?

0

None, the script is a server script, I get an error in my LOCAL output that says Bad Request. And using just :Teleport() makes the game freeze

1 answer

I use this code for my main games children, it should work. Simple and efficient! xd

port = game:service("TeleportService")
ID = -- Put the ID of the main place in here
function onClicked()
port:Teleport(ID)
end

script.Parent.MouseButton1Click:connect(onClicked)


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