I need to create a teleport from my lobby to another place in my game. I don’t want the player to teleport in on a spawn pad. I need to enter specific coordinates using cframe or vector3.
The problem is I can only test place teleporting by launching the game in Client, not Studio. It’s not possible to see what I’m doing wrong in client.
Here is my working script. This script transports players to another place and a specific spawn pad using TeleportToSpawnByName. I need to swap that function out with something but have searched and tried different things for 2 days and my mind just isn’t clicking. This script is perfect for someone needing it for TeleportToSpawnByName but not what I need.
local TeleportService = game:GetService("TeleportService")
local PlaceID = 12345678
local spawnName = "CustomName001"
local debounce = true
function onTouched(hit)
if debounce == true then
debounce = false
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
TeleportService:TeleportToSpawnByName (PlaceID, spawnName, player)
wait(0.2)
debounce = true
end
end
end
script.Parent.Touched:connect(onTouched)
Or step on something. But the thing is I’m trying to make the player land in an area that’s not a spawn pad. Basically because adding more than 1 pad messes up respawns and the player respawns randomly on any spawn pad.
What are you trying to achieve? If you want the player to spawn in a specific location upon being teleported from a different game, LocalPlayerArrivedFromTeleport would be the answer you’re looking for!
I’m trying to create the basic illusion of a person going from outside (lobby) to inside (new place). I just want them to load at the front door inside. Because I get no errors and can only test in Client, I tried this: I modified the above working script with what I’d expect to see (but have no idea). What’s wrong with this idea?
local TeleportService = game:GetService("TeleportService")
local PlaceID = 12345678
local TeleportLocation = CFrame.new(10.1, 10.46, 12.15)
local debounce = true
function onTouched(hit)
if debounce == true then
debounce = false
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
TeleportService:TeleportLocation (PlaceID, TeleportLocation, player)
wait(0.2)
debounce = true
end
end
end
script.Parent.Touched:connect(onTouched)
It’s the same game. The game has multiple places. Places as defined by Roblox… same game different server/level/place. To the player it looks like they are outside a building… touches/hit door… and is “transferred” inside the building. The entire interior is located in the other server/level/place.
Well I’d like to do that as above, but something is wrong in my script. There are zero errors in Studio though and it’s only testable in the real Roblox client.
For some reason place to place teleports don’t work at all in Studio. This is noted in the documentation and on the forum.
Why do I need to get data from there? The new place doesn’t need any info. The script in the old place should tell the player where to land using cframe or vector3 right? I’m missing the part of where or how to put in the coordinates.