Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
Poine 30
8 years ago

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

01game:GetService('TeleportService').CustomizedTeleportUI = true
02 
03ds = game:GetService("DataStoreService"):GetGlobalDataStore()
04 
05local handler = game:GetService("AssetService")
06local db = false
07 
08script.Parent.Touched:connect(function(hit)
09local h = hit.Parent:FindFirstChild("Humanoid")
10if and db == false then db = true
11local p = game.Players:FindFirstChild(h.Parent.Name)
12local createPlace = handler:CreatePlaceAsync(game.Players:FindFirstChild(p.Name).Name.."'s Apartment",445919249)   
13wait(1)
14game:GetService('TeleportService'):Teleport(createPlace,p) 
15db = false 
16end
17end)

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

01game:GetService('TeleportService').CustomizedTeleportUI = true
02 
03 
04script.Parent.MouseClick:connect(function(p)
05wait(2)
06game:GetService('TeleportService'):TeleportToPlaceInstance(372961598,1,p)
07wait(2)
08 
09 
10end)

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

0
What line is it on? arrowman888 69 — 8y
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 Poine 30 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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

1port = game:service("TeleportService")
2ID = -- Put the ID of the main place in here
3function onClicked()
4port:Teleport(ID)
5end
6 
7script.Parent.MouseButton1Click:connect(onClicked)
Ad

Answer this question