Hi!
So I want the player to touch a part and they teleport to a place inside of the starting place.
(Like going from the lobby to being teleported to the main game)
I’ve tried other solutions from other posts but none of them work for me or isn’t my situation. This is the code I have so far:
local part = script.Parent
part.Touched:Connect(function()
game:GetService('TeleportService'):Teleport(5789355763)
end)
local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local TARGET_PLACE_ID = 5789355763
local playerToTeleport = Players:GetPlayers()[1]
TeleportService:TeleportAsync(TARGET_PLACE_ID, {playerToTeleport}, teleportOptions)
local Part = script.Parent
local TeleportService = game:GetService('TeleportService')
local placeID = 0
local canTP = true
local function otherGame(otherPart)
local player = game.Players:FindFirstChild(otherPart.Parent.Name)
if player and canTP then
print("A")
canTP = false
TeleportService:Teleport(placeID, player)
end
end
Part.Touched:Connect(otherGame)