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

How to Make Camping Game Teleport [Lobby -> Game]?

Asked by 4 years ago

Hey There,

So i want to make a simple camping type game

But i still confused about

How you teleport player to another place?

Like, if the game already running nobody can join it.

And i also found this,

01TeleportService = game:GetService("TeleportService")
02GamePlaceId = 12345
03 
04function StartGameServerWithGroup(players)
05    local accessCode, serverId = TeleportService:ReserveServer(GamePlaceId)
06 
07    TeleportService:TeleportToPrivateServer(GamePlaceId, accessCode, players)
08end
09 
10StartGameServerWithGroup({game.Players.pro_developer213})

Source: https://devforum.roblox.com/t/how-does-camping-create-new-servers/397228/6

But i dont know how it work ;-;


Please Help If You Can!

Thank's for Reading!

0
Try this: epic_hen9 27 — 4y
0
Oops, sorry this was the wrong question epic_hen9 27 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

So if you're trying to create a private server then insert this script.

1local PlaceId = nil -- Replace with the game's id
2local TeleportService = game:GetService("TeleportService")
3local Code = TeleportService:ReserveServer(PlaceId)
4TeleportService:TeleportToPrivateServer(PlaceId, Code, game.Players:players())

I didn't test this out

0
Where accept button?! The_Saver31 260 — 4y
0
ow there it is The_Saver31 260 — 4y
Ad

Answer this question