#How to disallow players to join mid game!

1 messages · Page 1 of 1 (latest)

loud falcon
#

i have a que if im in my game and my friend tries to join he should not join me in betwwen the game he should teleport to main lobby just like 99 nights if im in game and my friend join me he will tp to lobby instead teleporting to forest!

lost frost
#

do something like this ``` local TeleportService = game:GetService("TeleportService")
local GAME_PLACE_ID = 123456789--replace this with your gameid

TeleportService:TeleportAsync(
GAME_PLACE_ID,
{player},
{ match = true }
)and then detect any player who joins into your game checking if they are match or not, if not then send them back to the lobby gamelocal TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")

local LOBBY_PLACE_ID = 987654321

Players.PlayerAdded:Connect(function(player)
local data = TeleportService:GetLocalPlayerTeleportData()
if not data or data.match ~= true then
TeleportService:Teleport(LOBBY_PLACE_ID, player)
end
end)

loud falcon
#

ty bro it worked !!!!!!😁

vast questBOT
#

studio** You are now Level 2! **studio

lost frost
#

Np

steep coral