I wanted to make a game where basically it is kinda like a lobby so you load into the game and when you press ready up it teleports you to another game and the only way you can get into that other game is through this games teleporter.
The problem is, i dont want ppl to go directly to the goal game instead of having to go through the teleporter game.
Ive tried making the game private but then the teleporter doesnt work.
For that, make your lobby the “Original” game. This is the game you want to set public. Then in your experience settings (Top left, File - Experience Settings), go to Places and make a new Place. This is where you will create your “actual game.”
After you have created your Place, go to Window (Top Left) and then go to Asset manager. Then Rightclick the Place and press Copy Place Id to Clipboard. In your script you would do:
local TeleportService = game:GetService("TeleportService")
local Player = (However you get your player instance)
TeleportService:Teleport(Put your place id here, Player)
If you go to your Creator Hub (the website), you can customize the permissions of the place there.
--
--LocalScript in the teleport from game
local player = game:GetService("Players").LocalPlayer
local ts = game:GetService("TeleportService")
local td = ts:GetLocalPlayerTeleportData()
local PortID = 123456789 --from
local GameID = 234567890 --to
if td then PortID = td["PortID"] end
local data = {}; data["PortID"] = PortID
pcall(function() ts:Teleport(GameID, player, data) end)
--
--ServerScript in the teleport to game
local PortID = 123456789
game:GetService("Players").PlayerAdded:Connect(function(player)
local data = player:GetJoinData().TeleportData
if data == nil or data["PortID"] ~= PortID then
player:Kick("Portal entry only.")
end
end)
That would be my concept, let’s see here..
Refined it a bit
--
--LocalScript teleport trigger
game:GetService("ReplicatedStorage"):WaitForChild("TeleportRemote"):FireServer()
--
--ServerScript in the teleport from game
local teleportService = game:GetService("TeleportService")
local remote = game:GetService("ReplicatedStorage"):WaitForChild("TeleportRemote")
local PortID = 123456789 --from
local GameID = 234567890 --to
local pending = {}
remote.OnServerEvent:Connect(function(player)
if pending[player] then return end
pending[player] = true
local data = {}; data["PortID"] = PortID
pcall(function() teleportService:Teleport(GameID, player, data) end)
end)
--
--ServerScript in the teleport to game
local PortID = 123456789
game:GetService("Players").PlayerAdded:Connect(function(player)
local data = player:GetJoinData().TeleportData
if data == nil or data["PortID"] ~= PortID then
player:Kick("Portal entry only.")
end
end)
And Not fully tested ..
But I did pull from some note scripts.
Added a anti spammer. You’ll have to test it.
do you mean places or actual seperate experiences?
if places, theres a toggle somewhere in the place configuration that lets you disallow direct joins from friends and stuff, so players can only get there by your game using teleportService.
Did you find them settings on the server he was talking about..
I didn’t see anything that would help this issue other than private.
Can you post what you did here?
Oh, I see you did an all in one with a pre game.. nice.